hi all, I am writing a second kind of node now, which pulls logs from a backend service.
my current idea is:
let the node be triggered from a “cron” trigger node
then load logs from the backend system
forward the logs one-by-one downstream
now, what kind of node is this? “transform
” seems wrong, “trigger
” as well.
and if I would “make” this a trigger node which pulls every n minutes, how would I write such a node? any examples?
cheers!
Probably you can send logs to a queue and receive them by any of next available services triggers in n8n:
amazon sns
amqp
mqtt
rabbitmq
Otherwise, you can try to create a webhook and send text logs to this endpoint.
Hope this helps.
yes, maybe. unfortunately I still don’t know which kind of node that is then .
(and I want to avoid queues … that would be an external dependency which I kinda can do without)
Perhaps you can try to send logs to webhook in n8n.
It’s the faster way to test your log sender and I have used in several simple use cases
jan
February 15, 2021, 8:36pm
5
For me it actually sounds like a trigger node as it triggers a workflow to run. The only difference is that it uses polling to do so. We already have a few nodes in n8n which work like that.
Here two examples:
import * as moment from 'moment-timezone';
import { IPollFunctions } from 'n8n-core';
import {
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import {
clockifyApiRequest,
} from './GenericFunctions';
import { EntryTypeEnum } from './EntryTypeEnum';
import { IUserDto } from './UserDtos';
import { IWorkspaceDto } from './WorkpaceInterfaces';
This file has been truncated. show original
import { IPollFunctions } from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
INodeType,
INodeTypeDescription,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import * as moment from 'moment';
import { togglApiRequest } from './GenericFunctions';
export class TogglTrigger implements INodeType {
description: INodeTypeDescription = {
displayName: 'Toggl Trigger',
name: 'togglTrigger',
icon: 'file:toggl.png',
group: ['trigger'],
version: 1,
This file has been truncated. show original
@jan would be my impression as well, thanks for the links