diff --git a/packages/editor-ui/src/__tests__/defaults.ts b/packages/editor-ui/src/__tests__/defaults.ts
index b3b18bdb5f1904..b1a0e0dec8057f 100644
--- a/packages/editor-ui/src/__tests__/defaults.ts
+++ b/packages/editor-ui/src/__tests__/defaults.ts
@@ -1,59 +1,4 @@
-import type { INodeTypeData, INodeTypeDescription, IN8nUISettings } from 'n8n-workflow';
-import {
- AGENT_NODE_TYPE,
- SET_NODE_TYPE,
- CHAT_TRIGGER_NODE_TYPE,
- MANUAL_TRIGGER_NODE_TYPE,
-} from '@/constants';
-import nodeTypesJson from '../../../nodes-base/dist/types/nodes.json';
-import aiNodeTypesJson from '../../../@n8n/nodes-langchain/dist/types/nodes.json';
-
-const allNodeTypes = [...nodeTypesJson, ...aiNodeTypesJson];
-
-export function findNodeTypeDescriptionByName(name: string): INodeTypeDescription {
- return allNodeTypes.find((node) => node.name === name) as INodeTypeDescription;
-}
-
-export const testingNodeTypes: INodeTypeData = {
- [MANUAL_TRIGGER_NODE_TYPE]: {
- sourcePath: '',
- type: {
- description: findNodeTypeDescriptionByName(MANUAL_TRIGGER_NODE_TYPE),
- },
- },
- [SET_NODE_TYPE]: {
- sourcePath: '',
- type: {
- description: findNodeTypeDescriptionByName(SET_NODE_TYPE),
- },
- },
- [CHAT_TRIGGER_NODE_TYPE]: {
- sourcePath: '',
- type: {
- description: findNodeTypeDescriptionByName(CHAT_TRIGGER_NODE_TYPE),
- },
- },
- [AGENT_NODE_TYPE]: {
- sourcePath: '',
- type: {
- description: findNodeTypeDescriptionByName(AGENT_NODE_TYPE),
- },
- },
-};
-
-export const defaultMockNodeTypes: INodeTypeData = {
- [MANUAL_TRIGGER_NODE_TYPE]: testingNodeTypes[MANUAL_TRIGGER_NODE_TYPE],
- [SET_NODE_TYPE]: testingNodeTypes[SET_NODE_TYPE],
-};
-
-export function mockNodeTypesToArray(nodeTypes: INodeTypeData): INodeTypeDescription[] {
- return Object.values(nodeTypes).map(
- (nodeType) => nodeType.type.description as INodeTypeDescription,
- );
-}
-
-export const defaultMockNodeTypesArray: INodeTypeDescription[] =
- mockNodeTypesToArray(defaultMockNodeTypes);
+import type { IN8nUISettings } from 'n8n-workflow';
export const defaultSettings: IN8nUISettings = {
allowedModules: {},
diff --git a/packages/editor-ui/src/__tests__/mocks.ts b/packages/editor-ui/src/__tests__/mocks.ts
index 65de1a99c4f8e5..d8916bbc6f3c46 100644
--- a/packages/editor-ui/src/__tests__/mocks.ts
+++ b/packages/editor-ui/src/__tests__/mocks.ts
@@ -2,48 +2,76 @@ import type {
INodeType,
INodeTypeData,
INodeTypes,
- IVersionedNodeType,
IConnections,
IDataObject,
INode,
IPinData,
IWorkflowSettings,
+ LoadedClass,
+ INodeTypeDescription,
} from 'n8n-workflow';
import { NodeHelpers, Workflow } from 'n8n-workflow';
import { uuid } from '@jsplumb/util';
-import { defaultMockNodeTypes } from '@/__tests__/defaults';
-import type { INodeUi, ITag, IUsedCredential, IWorkflowDb, WorkflowMetadata } from '@/Interface';
-import type { ProjectSharingData } from '@/types/projects.types';
-import type { RouteLocationNormalized } from 'vue-router';
+import { mock } from 'vitest-mock-extended';
-export function createTestNodeTypes(data: INodeTypeData = {}): INodeTypes {
- const nodeTypes = {
- ...defaultMockNodeTypes,
- ...Object.keys(data).reduce By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }.
Once you're happy with your workflow, activate it. Then every time an email is received, the workflow will execute. These executions will show up in the executions list, but not in the editor.",
- active:
- "While building your workflow, click the 'listen' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.
Your workflow will also execute automatically, since it's activated. Every time an email is received, this node will trigger an execution. These executions will show up in the executions list, but not in the editor.",
- },
- activationHint:
- "Once you’ve finished building your workflow, activate it to have it also listen continuously (you just won’t see those executions here).",
- },
- inputs: [],
- outputs: ['main'],
- credentials: [{ name: 'imap', required: true, testedBy: 'imapConnectionTest' }],
- properties: [
- { displayName: 'Mailbox Name', name: 'mailbox', type: 'string', default: 'INBOX' },
- {
- displayName: 'Action',
- name: 'postProcessAction',
- type: 'options',
- options: [
- { name: 'Mark as Read', value: 'read' },
- { name: 'Nothing', value: 'nothing' },
- ],
- default: 'read',
- description:
- 'What to do after the email has been received. If "nothing" gets selected it will be processed multiple times.',
- },
- {
- displayName: 'Download Attachments',
- name: 'downloadAttachments',
- type: 'boolean',
- default: false,
- displayOptions: { show: { format: ['simple'] } },
- description:
- 'Whether attachments of emails should be downloaded. Only set if needed as it increases processing.',
- },
- {
- displayName: 'Format',
- name: 'format',
- type: 'options',
- options: [
- {
- name: 'RAW',
- value: 'raw',
- description:
- 'Returns the full email message data with body content in the raw field as a base64url encoded string; the payload field is not used',
- },
- {
- name: 'Resolved',
- value: 'resolved',
- description:
- 'Returns the full email with all data resolved and attachments saved as binary data',
- },
- {
- name: 'Simple',
- value: 'simple',
- description:
- 'Returns the full email; do not use if you wish to gather inline attachments',
- },
- ],
- default: 'simple',
- description: 'The format to return the message in',
- },
- {
- displayName: 'Property Prefix Name',
- name: 'dataPropertyAttachmentsPrefixName',
- type: 'string',
- default: 'attachment_',
- displayOptions: { show: { format: ['resolved'] } },
- description:
- 'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is "attachment_" the first attachment is saved to "attachment_0"',
- },
- {
- displayName: 'Property Prefix Name',
- name: 'dataPropertyAttachmentsPrefixName',
- type: 'string',
- default: 'attachment_',
- displayOptions: { show: { format: ['simple'], downloadAttachments: [true] } },
- description:
- 'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is "attachment_" the first attachment is saved to "attachment_0"',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- options: [
- {
- displayName: 'Custom Email Rules',
- name: 'customEmailConfig',
- type: 'string',
- default: '["UNSEEN"]',
- description:
- 'Custom email fetching rules. See node-imap\'s search function for more details.',
- },
- {
- displayName: 'Ignore SSL Issues',
- name: 'allowUnauthorizedCerts',
- type: 'boolean',
- default: false,
- description: 'Whether to connect even if SSL certificate validation is not possible',
- },
- {
- displayName: 'Force Reconnect',
- name: 'forceReconnect',
- type: 'number',
- default: 60,
- description: 'Sets an interval (in minutes) to force a reconnection',
- },
- ],
- },
- ],
- codex: {
- categories: ['Communication', 'Core Nodes'],
- subcategories: { 'Core Nodes': ['Other Trigger Nodes'] },
- resources: {
- primaryDocumentation: [
- {
- url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.emailimap/',
- },
- ],
- credentialDocumentation: [{ url: 'https://docs.n8n.io/credentials/imap' }],
- },
- },
-} satisfies INodeTypeDescription;
-
-export const nodeTypeReadImapV2 = {
- displayName: 'Email Trigger (IMAP)',
- name: 'n8n-nodes-base.emailReadImap',
- icon: 'fa:inbox',
- group: ['trigger'],
- description: 'Triggers the workflow when a new email is received',
- defaultVersion: 2,
- version: 2,
- eventTriggerDescription: 'Waiting for you to receive an email',
- defaults: { name: 'Email Trigger (IMAP)', color: '#44AA22' },
- triggerPanel: {
- header: '',
- executionsHelp: {
- inactive:
- "While building your workflow, click the 'listen' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.
Once you're happy with your workflow, activate it. Then every time an email is received, the workflow will execute. These executions will show up in the executions list, but not in the editor.",
- active:
- "While building your workflow, click the 'listen' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.
Your workflow will also execute automatically, since it's activated. Every time an email is received, this node will trigger an execution. These executions will show up in the executions list, but not in the editor.",
- },
- activationHint:
- "Once you’ve finished building your workflow, activate it to have it also listen continuously (you just won’t see those executions here).",
- },
- inputs: [],
- outputs: ['main'],
- credentials: [{ name: 'imap', required: true, testedBy: 'imapConnectionTest' }],
- properties: [
- { displayName: 'Mailbox Name', name: 'mailbox', type: 'string', default: 'INBOX' },
- {
- displayName: 'Action',
- name: 'postProcessAction',
- type: 'options',
- options: [
- { name: 'Mark as Read', value: 'read' },
- { name: 'Nothing', value: 'nothing' },
- ],
- default: 'read',
- description:
- 'What to do after the email has been received. If "nothing" gets selected it will be processed multiple times.',
- },
- {
- displayName: 'Download Attachments',
- name: 'downloadAttachments',
- type: 'boolean',
- default: false,
- displayOptions: { show: { format: ['simple'] } },
- description:
- 'Whether attachments of emails should be downloaded. Only set if needed as it increases processing.',
- },
- {
- displayName: 'Format',
- name: 'format',
- type: 'options',
- options: [
- {
- name: 'RAW',
- value: 'raw',
- description:
- 'Returns the full email message data with body content in the raw field as a base64url encoded string; the payload field is not used',
- },
- {
- name: 'Resolved',
- value: 'resolved',
- description:
- 'Returns the full email with all data resolved and attachments saved as binary data',
- },
- {
- name: 'Simple',
- value: 'simple',
- description:
- 'Returns the full email; do not use if you wish to gather inline attachments',
- },
- ],
- default: 'simple',
- description: 'The format to return the message in',
- },
- {
- displayName: 'Property Prefix Name',
- name: 'dataPropertyAttachmentsPrefixName',
- type: 'string',
- default: 'attachment_',
- displayOptions: { show: { format: ['resolved'] } },
- description:
- 'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is "attachment_" the first attachment is saved to "attachment_0"',
- },
- {
- displayName: 'Property Prefix Name',
- name: 'dataPropertyAttachmentsPrefixName',
- type: 'string',
- default: 'attachment_',
- displayOptions: { show: { format: ['simple'], downloadAttachments: [true] } },
- description:
- 'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is "attachment_" the first attachment is saved to "attachment_0"',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- options: [
- {
- displayName: 'Custom Email Rules',
- name: 'customEmailConfig',
- type: 'string',
- default: '["UNSEEN"]',
- description:
- 'Custom email fetching rules. See node-imap\'s search function for more details.',
- },
- {
- displayName: 'Force Reconnect Every Minutes',
- name: 'forceReconnect',
- type: 'number',
- default: 60,
- description: 'Sets an interval (in minutes) to force a reconnection',
- },
- ],
- },
- ],
- codex: {
- categories: ['Communication', 'Core Nodes'],
- subcategories: { 'Core Nodes': ['Other Trigger Nodes'] },
- resources: {
- primaryDocumentation: [
- {
- url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.emailimap/',
- },
- ],
- credentialDocumentation: [{ url: 'https://docs.n8n.io/credentials/imap' }],
- },
- },
-} satisfies INodeTypeDescription;
-
-export const nodeTypeNextCloudV1 = {
- displayName: 'Nextcloud',
- name: 'n8n-nodes-base.nextCloud',
- group: ['input'],
- version: 1,
- subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
- description: 'Access data on Nextcloud',
- defaults: { name: 'Nextcloud' },
- inputs: ['main'],
- outputs: ['main'],
- credentials: [
- {
- name: 'nextCloudApi',
- required: true,
- displayOptions: { show: { authentication: ['accessToken'] } },
- },
- {
- name: 'nextCloudOAuth2Api',
- required: true,
- displayOptions: { show: { authentication: ['oAuth2'] } },
- },
- ],
- properties: [
- {
- displayName: 'Authentication',
- name: 'authentication',
- type: 'options',
- options: [
- { name: 'Access Token', value: 'accessToken' },
- { name: 'OAuth2', value: 'oAuth2' },
- ],
- default: 'accessToken',
- },
- {
- displayName: 'Resource',
- name: 'resource',
- type: 'options',
- noDataExpression: true,
- options: [
- { name: 'File', value: 'file' },
- { name: 'Folder', value: 'folder' },
- { name: 'User', value: 'user' },
- { name: 'Custom API Call', value: '__CUSTOM_API_CALL__' },
- ],
- default: 'file',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['file'] } },
- options: [
- { name: 'Copy', value: 'copy', description: 'Copy a file', action: 'Copy a file' },
- {
- name: 'Delete',
- value: 'delete',
- description: 'Delete a file',
- action: 'Delete a file',
- },
- {
- name: 'Download',
- value: 'download',
- description: 'Download a file',
- action: 'Download a file',
- },
- { name: 'Move', value: 'move', description: 'Move a file', action: 'Move a file' },
- { name: 'Share', value: 'share', description: 'Share a file', action: 'Share a file' },
- {
- name: 'Upload',
- value: 'upload',
- description: 'Upload a file',
- action: 'Upload a file',
- },
- { name: 'Custom API Call', value: '__CUSTOM_API_CALL__' },
- ],
- default: 'upload',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['folder'] } },
- options: [
- { name: 'Copy', value: 'copy', description: 'Copy a folder', action: 'Copy a folder' },
- {
- name: 'Create',
- value: 'create',
- description: 'Create a folder',
- action: 'Create a folder',
- },
- {
- name: 'Delete',
- value: 'delete',
- description: 'Delete a folder',
- action: 'Delete a folder',
- },
- {
- name: 'List',
- value: 'list',
- description: 'Return the contents of a given folder',
- action: 'List a folder',
- },
- { name: 'Move', value: 'move', description: 'Move a folder', action: 'Move a folder' },
- {
- name: 'Share',
- value: 'share',
- description: 'Share a folder',
- action: 'Share a folder',
- },
- { name: 'Custom API Call', value: '__CUSTOM_API_CALL__' },
- ],
- default: 'create',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['user'] } },
- options: [
- {
- name: 'Create',
- value: 'create',
- description: 'Invite a user to a NextCloud organization',
- action: 'Create a user',
- },
- {
- name: 'Delete',
- value: 'delete',
- description: 'Delete a user',
- action: 'Delete a user',
- },
- {
- name: 'Get',
- value: 'get',
- description: 'Retrieve information about a single user',
- action: 'Get a user',
- },
- {
- name: 'Get Many',
- value: 'getAll',
- description: 'Retrieve a list of users',
- action: 'Get many users',
- },
- {
- name: 'Update',
- value: 'update',
- description: 'Edit attributes related to a user',
- action: 'Update a user',
- },
- { name: 'Custom API Call', value: '__CUSTOM_API_CALL__' },
- ],
- default: 'create',
- },
- {
- displayName: 'From Path',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['copy'], resource: ['file', 'folder'] } },
- placeholder: '/invoices/original.txt',
- description: 'The path of file or folder to copy. The path should start with "/".',
- },
- {
- displayName: 'To Path',
- name: 'toPath',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['copy'], resource: ['file', 'folder'] } },
- placeholder: '/invoices/copy.txt',
- description: 'The destination path of file or folder. The path should start with "/".',
- },
- {
- displayName: 'Delete Path',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['delete'], resource: ['file', 'folder'] } },
- placeholder: '/invoices/2019/invoice_1.pdf',
- description:
- 'The path to delete. Can be a single file or a whole folder. The path should start with "/".',
- },
- {
- displayName: 'From Path',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['move'], resource: ['file', 'folder'] } },
- placeholder: '/invoices/old_name.txt',
- description: 'The path of file or folder to move. The path should start with "/".',
- },
- {
- displayName: 'To Path',
- name: 'toPath',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['move'], resource: ['file', 'folder'] } },
- placeholder: '/invoices/new_name.txt',
- description: 'The new path of file or folder. The path should start with "/".',
- },
- {
- displayName: 'File Path',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['download'], resource: ['file'] } },
- placeholder: '/invoices/2019/invoice_1.pdf',
- description:
- 'The file path of the file to download. Has to contain the full path. The path should start with "/".',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- required: true,
- displayOptions: { show: { operation: ['download'], resource: ['file'] } },
- description: 'Name of the binary property to which to write the data of the read file',
- },
- {
- displayName: 'File Path',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['upload'], resource: ['file'] } },
- placeholder: '/invoices/2019/invoice_1.pdf',
- description:
- 'The absolute file path of the file to upload. Has to contain the full path. The parent folder has to exist. Existing files get overwritten.',
- },
- {
- displayName: 'Binary Data',
- name: 'binaryDataUpload',
- type: 'boolean',
- default: false,
- required: true,
- displayOptions: { show: { operation: ['upload'], resource: ['file'] } },
- },
- {
- displayName: 'File Content',
- name: 'fileContent',
- type: 'string',
- default: '',
- displayOptions: {
- show: { binaryDataUpload: [false], operation: ['upload'], resource: ['file'] },
- },
- placeholder: '',
- description: 'The text content of the file to upload',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- required: true,
- displayOptions: {
- show: { binaryDataUpload: [true], operation: ['upload'], resource: ['file'] },
- },
- placeholder: '',
- description:
- 'Name of the binary property which contains the data for the file to be uploaded',
- },
- {
- displayName: 'File Path',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['share'], resource: ['file', 'folder'] } },
- placeholder: '/invoices/2019/invoice_1.pdf',
- description:
- 'The file path of the file to share. Has to contain the full path. The path should start with "/".',
- },
- {
- displayName: 'Share Type',
- name: 'shareType',
- type: 'options',
- displayOptions: { show: { operation: ['share'], resource: ['file', 'folder'] } },
- options: [
- { name: 'Circle', value: 7 },
- { name: 'Email', value: 4 },
- { name: 'Group', value: 1 },
- { name: 'Public Link', value: 3 },
- { name: 'User', value: 0 },
- ],
- default: 0,
- description: 'The share permissions to set',
- },
- {
- displayName: 'Circle ID',
- name: 'circleId',
- type: 'string',
- displayOptions: {
- show: { resource: ['file', 'folder'], operation: ['share'], shareType: [7] },
- },
- default: '',
- description: 'The ID of the circle to share with',
- },
- {
- displayName: 'Email',
- name: 'email',
- type: 'string',
- placeholder: 'name@email.com',
- displayOptions: {
- show: { resource: ['file', 'folder'], operation: ['share'], shareType: [4] },
- },
- default: '',
- description: 'The Email address to share with',
- },
- {
- displayName: 'Group ID',
- name: 'groupId',
- type: 'string',
- displayOptions: {
- show: { resource: ['file', 'folder'], operation: ['share'], shareType: [1] },
- },
- default: '',
- description: 'The ID of the group to share with',
- },
- {
- displayName: 'User',
- name: 'user',
- type: 'string',
- displayOptions: {
- show: { resource: ['file', 'folder'], operation: ['share'], shareType: [0] },
- },
- default: '',
- description: 'The user to share with',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- displayOptions: { show: { resource: ['file', 'folder'], operation: ['share'] } },
- options: [
- {
- displayName: 'Password',
- name: 'password',
- type: 'string',
- typeOptions: { password: true },
- displayOptions: {
- show: { '/resource': ['file', 'folder'], '/operation': ['share'], '/shareType': [3] },
- },
- default: '',
- description: 'Optional search string',
- },
- {
- displayName: 'Permissions',
- name: 'permissions',
- type: 'options',
- options: [
- { name: 'All', value: 31 },
- { name: 'Create', value: 4 },
- { name: 'Delete', value: 8 },
- { name: 'Read', value: 1 },
- { name: 'Update', value: 2 },
- ],
- default: 1,
- description: 'The share permissions to set',
- },
- ],
- },
- {
- displayName: 'Folder',
- name: 'path',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { operation: ['create'], resource: ['folder'] } },
- placeholder: '/invoices/2019',
- description:
- 'The folder to create. The parent folder has to exist. The path should start with "/".',
- },
- {
- displayName: 'Folder Path',
- name: 'path',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['list'], resource: ['folder'] } },
- placeholder: '/invoices/2019/',
- description: 'The path of which to list the content. The path should start with "/".',
- },
- {
- displayName: 'Username',
- name: 'userId',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { resource: ['user'], operation: ['create'] } },
- placeholder: 'john',
- description: 'Username the user will have',
- },
- {
- displayName: 'Email',
- name: 'email',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { resource: ['user'], operation: ['create'] } },
- placeholder: 'john@email.com',
- description: 'The email of the user to invite',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- displayOptions: { show: { resource: ['user'], operation: ['create'] } },
- options: [
- {
- displayName: 'Display Name',
- name: 'displayName',
- type: 'string',
- default: '',
- description: 'The display name of the user to invite',
- },
- ],
- },
- {
- displayName: 'Username',
- name: 'userId',
- type: 'string',
- default: '',
- required: true,
- displayOptions: { show: { resource: ['user'], operation: ['delete', 'get', 'update'] } },
- placeholder: 'john',
- description: 'Username the user will have',
- },
- {
- displayName: 'Return All',
- name: 'returnAll',
- type: 'boolean',
- displayOptions: { show: { resource: ['user'], operation: ['getAll'] } },
- default: false,
- description: 'Whether to return all results or only up to a given limit',
- },
- {
- displayName: 'Limit',
- name: 'limit',
- type: 'number',
- displayOptions: { show: { resource: ['user'], operation: ['getAll'], returnAll: [false] } },
- typeOptions: { minValue: 1, maxValue: 100 },
- default: 50,
- description: 'Max number of results to return',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- displayOptions: { show: { resource: ['user'], operation: ['getAll'] } },
- options: [
- {
- displayName: 'Search',
- name: 'search',
- type: 'string',
- default: '',
- description: 'Optional search string',
- },
- {
- displayName: 'Offset',
- name: 'offset',
- type: 'number',
- default: '',
- description: 'Optional offset value',
- },
- ],
- },
- {
- displayName: 'Update Fields',
- name: 'updateFields',
- type: 'fixedCollection',
- typeOptions: { multipleValues: false },
- placeholder: 'Add Option',
- default: {},
- displayOptions: { show: { resource: ['user'], operation: ['update'] } },
- options: [
- {
- displayName: 'Fields',
- name: 'field',
- values: [
- {
- displayName: 'Key',
- name: 'key',
- type: 'options',
- default: 'email',
- options: [
- {
- name: 'Address',
- value: 'address',
- description: 'The new address for the user',
- },
- {
- name: 'Display Name',
- value: 'displayname',
- description: 'The new display name for the user',
- },
- { name: 'Email', value: 'email', description: 'The new email for the user' },
- {
- name: 'Password',
- value: 'password',
- description: 'The new password for the user',
- },
- {
- name: 'Twitter',
- value: 'twitter',
- description: 'The new twitter handle for the user',
- },
- {
- name: 'Website',
- value: 'website',
- description: 'The new website for the user',
- },
- ],
- description: 'Key of the updated attribute',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value of the updated attribute',
- },
- ],
- },
- ],
- },
- ],
- codex: {
- categories: ['Data & Storage'],
- resources: {
- primaryDocumentation: [
- { url: 'https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.nextcloud/' },
- ],
- credentialDocumentation: [{ url: 'https://docs.n8n.io/credentials/nextCloud' }],
- },
- },
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/NextCloud/nextcloud.svg',
-} satisfies INodeTypeDescription;
-
-export const nodeTypeTelegramV1 = {
- displayName: 'Telegram',
- name: 'n8n-nodes-base.telegram',
- group: ['output'],
- version: [1, 1.1],
- subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
- description: 'Sends data to Telegram',
- defaults: { name: 'Telegram' },
- inputs: ['main'],
- outputs: ['main'],
- credentials: [{ name: 'telegramApi', required: true }],
- properties: [
- {
- displayName: 'Resource',
- name: 'resource',
- type: 'options',
- noDataExpression: true,
- options: [
- { name: 'Chat', value: 'chat' },
- { name: 'Callback', value: 'callback' },
- { name: 'File', value: 'file' },
- { name: 'Message', value: 'message' },
- ],
- default: 'message',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['chat'] } },
- options: [
- {
- name: 'Get',
- value: 'get',
- description: 'Get up to date information about a chat',
- action: 'Get a chat',
- },
- {
- name: 'Get Administrators',
- value: 'administrators',
- description: 'Get the Administrators of a chat',
- action: 'Get all administrators in a chat',
- },
- {
- name: 'Get Member',
- value: 'member',
- description: 'Get the member of a chat',
- action: 'Get a member in a chat',
- },
- {
- name: 'Leave',
- value: 'leave',
- description: 'Leave a group, supergroup or channel',
- action: 'Leave a chat',
- },
- {
- name: 'Set Description',
- value: 'setDescription',
- description: 'Set the description of a chat',
- action: 'Set description on a chat',
- },
- {
- name: 'Set Title',
- value: 'setTitle',
- description: 'Set the title of a chat',
- action: 'Set a title on a chat',
- },
- ],
- default: 'get',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['callback'] } },
- options: [
- {
- name: 'Answer Query',
- value: 'answerQuery',
- description: 'Send answer to callback query sent from inline keyboard',
- action: 'Answer Query a callback',
- },
- {
- name: 'Answer Inline Query',
- value: 'answerInlineQuery',
- description: 'Send answer to callback query sent from inline bot',
- action: 'Answer an inline query callback',
- },
- ],
- default: 'answerQuery',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['file'] } },
- options: [{ name: 'Get', value: 'get', description: 'Get a file', action: 'Get a file' }],
- default: 'get',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['message'] } },
- options: [
- {
- name: 'Delete Chat Message',
- value: 'deleteMessage',
- description: 'Delete a chat message',
- action: 'Delete a chat message',
- },
- {
- name: 'Edit Message Text',
- value: 'editMessageText',
- description: 'Edit a text message',
- action: 'Edit a test message',
- },
- {
- name: 'Pin Chat Message',
- value: 'pinChatMessage',
- description: 'Pin a chat message',
- action: 'Pin a chat message',
- },
- {
- name: 'Send Animation',
- value: 'sendAnimation',
- description: 'Send an animated file',
- action: 'Send an animated file',
- },
- {
- name: 'Send Audio',
- value: 'sendAudio',
- description: 'Send a audio file',
- action: 'Send an audio file',
- },
- {
- name: 'Send Chat Action',
- value: 'sendChatAction',
- description: 'Send a chat action',
- action: 'Send a chat action',
- },
- {
- name: 'Send Document',
- value: 'sendDocument',
- description: 'Send a document',
- action: 'Send a document',
- },
- {
- name: 'Send Location',
- value: 'sendLocation',
- description: 'Send a location',
- action: 'Send a location',
- },
- {
- name: 'Send Media Group',
- value: 'sendMediaGroup',
- description: 'Send group of photos or videos to album',
- action: 'Send a media group message',
- },
- {
- name: 'Send Message',
- value: 'sendMessage',
- description: 'Send a text message',
- action: 'Send a text message',
- },
- {
- name: 'Send Photo',
- value: 'sendPhoto',
- description: 'Send a photo',
- action: 'Send a photo message',
- },
- {
- name: 'Send Sticker',
- value: 'sendSticker',
- description: 'Send a sticker',
- action: 'Send a sticker',
- },
- {
- name: 'Send Video',
- value: 'sendVideo',
- description: 'Send a video',
- action: 'Send a video',
- },
- {
- name: 'Unpin Chat Message',
- value: 'unpinChatMessage',
- description: 'Unpin a chat message',
- action: 'Unpin a chat message',
- },
- ],
- default: 'sendMessage',
- },
- {
- displayName: 'Chat ID',
- name: 'chatId',
- type: 'string',
- default: '',
- displayOptions: {
- show: {
- operation: [
- 'administrators',
- 'deleteMessage',
- 'get',
- 'leave',
- 'member',
- 'pinChatMessage',
- 'setDescription',
- 'setTitle',
- 'sendAnimation',
- 'sendAudio',
- 'sendChatAction',
- 'sendDocument',
- 'sendLocation',
- 'sendMessage',
- 'sendMediaGroup',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- 'unpinChatMessage',
- ],
- resource: ['chat', 'message'],
- },
- },
- required: true,
- description:
- 'Unique identifier for the target chat or username of the target channel (in the format @channelusername)',
- },
- {
- displayName: 'Message ID',
- name: 'messageId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['deleteMessage'], resource: ['message'] } },
- required: true,
- description: 'Unique identifier of the message to delete',
- },
- {
- displayName: 'Message ID',
- name: 'messageId',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['pinChatMessage', 'unpinChatMessage'], resource: ['message'] },
- },
- required: true,
- description: 'Unique identifier of the message to pin or unpin',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { operation: ['pinChatMessage'], resource: ['message'] } },
- default: {},
- options: [
- {
- displayName: 'Disable Notification',
- name: 'disable_notification',
- type: 'boolean',
- default: false,
- description:
- 'Whether to send a notification to all chat members about the new pinned message',
- },
- ],
- },
- {
- displayName: 'User ID',
- name: 'userId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['member'], resource: ['chat'] } },
- required: true,
- description: 'Unique identifier of the target user',
- },
- {
- displayName: 'Description',
- name: 'description',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['setDescription'], resource: ['chat'] } },
- required: true,
- description: 'New chat description, 0-255 characters',
- },
- {
- displayName: 'Title',
- name: 'title',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['setTitle'], resource: ['chat'] } },
- required: true,
- description: 'New chat title, 1-255 characters',
- },
- {
- displayName: 'Query ID',
- name: 'queryId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['answerQuery'], resource: ['callback'] } },
- required: true,
- description: 'Unique identifier for the query to be answered',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { operation: ['answerQuery'], resource: ['callback'] } },
- default: {},
- options: [
- {
- displayName: 'Cache Time',
- name: 'cache_time',
- type: 'number',
- typeOptions: { minValue: 0 },
- default: 0,
- description:
- 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
- },
- {
- displayName: 'Show Alert',
- name: 'show_alert',
- type: 'boolean',
- default: false,
- description:
- 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
- },
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description:
- 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
- },
- {
- displayName: 'URL',
- name: 'url',
- type: 'string',
- default: '',
- description: "URL that will be opened by the user's client",
- },
- ],
- },
- {
- displayName: 'Query ID',
- name: 'queryId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['answerInlineQuery'], resource: ['callback'] } },
- required: true,
- description: 'Unique identifier for the answered query',
- },
- {
- displayName: 'Results',
- name: 'results',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['answerInlineQuery'], resource: ['callback'] } },
- required: true,
- description: 'A JSON-serialized array of results for the inline query',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { operation: ['answerInlineQuery'], resource: ['callback'] } },
- default: {},
- options: [
- {
- displayName: 'Cache Time',
- name: 'cache_time',
- type: 'number',
- typeOptions: { minValue: 0 },
- default: 0,
- description:
- 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
- },
- {
- displayName: 'Show Alert',
- name: 'show_alert',
- type: 'boolean',
- default: false,
- description:
- 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
- },
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description:
- 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
- },
- {
- displayName: 'URL',
- name: 'url',
- type: 'string',
- default: '',
- description: "URL that will be opened by the user's client",
- },
- ],
- },
- {
- displayName: 'File ID',
- name: 'fileId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['get'], resource: ['file'] } },
- required: true,
- description: 'The ID of the file',
- },
- {
- displayName: 'Download',
- name: 'download',
- type: 'boolean',
- displayOptions: { show: { operation: ['get'], resource: ['file'] } },
- default: true,
- description: 'Whether to download the file',
- },
- {
- displayName: 'Message Type',
- name: 'messageType',
- type: 'options',
- displayOptions: { show: { operation: ['editMessageText'], resource: ['message'] } },
- options: [
- { name: 'Inline Message', value: 'inlineMessage' },
- { name: 'Message', value: 'message' },
- ],
- default: 'message',
- description: 'The type of the message to edit',
- },
- {
- displayName: 'Chat ID',
- name: 'chatId',
- type: 'string',
- default: '',
- displayOptions: {
- show: { messageType: ['message'], operation: ['editMessageText'], resource: ['message'] },
- },
- required: true,
- description:
- 'Unique identifier for the target chat or username of the target channel (in the format @channelusername). To find your chat ID ask @get_id_bot.',
- },
- {
- displayName: 'Binary Data',
- name: 'binaryData',
- type: 'boolean',
- default: false,
- required: true,
- displayOptions: {
- show: {
- operation: [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- 'sendSticker',
- ],
- resource: ['message'],
- },
- },
- description: 'Whether the data to upload should be taken from binary field',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- required: true,
- displayOptions: {
- show: {
- operation: [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- 'sendSticker',
- ],
- resource: ['message'],
- binaryData: [true],
- },
- },
- placeholder: '',
- description: 'Name of the binary property that contains the data to upload',
- },
- {
- displayName: 'Message ID',
- name: 'messageId',
- type: 'string',
- default: '',
- displayOptions: {
- show: { messageType: ['message'], operation: ['editMessageText'], resource: ['message'] },
- },
- required: true,
- description: 'Unique identifier of the message to edit',
- },
- {
- displayName: 'Inline Message ID',
- name: 'inlineMessageId',
- type: 'string',
- default: '',
- displayOptions: {
- show: {
- messageType: ['inlineMessage'],
- operation: ['editMessageText'],
- resource: ['message'],
- },
- },
- required: true,
- description: 'Unique identifier of the inline message to edit',
- },
- {
- displayName: 'Reply Markup',
- name: 'replyMarkup',
- displayOptions: { show: { operation: ['editMessageText'], resource: ['message'] } },
- type: 'options',
- options: [
- { name: 'None', value: 'none' },
- { name: 'Inline Keyboard', value: 'inlineKeyboard' },
- ],
- default: 'none',
- description: 'Additional interface options',
- },
- {
- displayName: 'Animation',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendAnimation'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Animation to send. Pass a file_id to send an animation that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get an animation from the Internet.',
- },
- {
- displayName: 'Audio',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendAudio'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Audio file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Action',
- name: 'action',
- type: 'options',
- displayOptions: { show: { operation: ['sendChatAction'], resource: ['message'] } },
- options: [
- { name: 'Find Location', value: 'find_location', action: 'Find location' },
- { name: 'Record Audio', value: 'record_audio', action: 'Record audio' },
- { name: 'Record Video', value: 'record_video', action: 'Record video' },
- { name: 'Record Video Note', value: 'record_video_note', action: 'Record video note' },
- { name: 'Typing', value: 'typing', action: 'Typing a message' },
- { name: 'Upload Audio', value: 'upload_audio', action: 'Upload audio' },
- { name: 'Upload Document', value: 'upload_document', action: 'Upload document' },
- { name: 'Upload Photo', value: 'upload_photo', action: 'Upload photo' },
- { name: 'Upload Video', value: 'upload_video', action: 'Upload video' },
- { name: 'Upload Video Note', value: 'upload_video_note', action: 'Upload video note' },
- ],
- default: 'typing',
- description:
- 'Type of action to broadcast. Choose one, depending on what the user is about to receive. The status is set for 5 seconds or less (when a message arrives from your bot).',
- },
- {
- displayName: 'Document',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendDocument'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Document to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Latitude',
- name: 'latitude',
- type: 'number',
- default: 0,
- typeOptions: { numberPrecision: 10, minValue: -90, maxValue: 90 },
- displayOptions: { show: { operation: ['sendLocation'], resource: ['message'] } },
- description: 'Location latitude',
- },
- {
- displayName: 'Longitude',
- name: 'longitude',
- type: 'number',
- typeOptions: { numberPrecision: 10, minValue: -180, maxValue: 180 },
- default: 0,
- displayOptions: { show: { operation: ['sendLocation'], resource: ['message'] } },
- description: 'Location longitude',
- },
- {
- displayName: 'Media',
- name: 'media',
- type: 'fixedCollection',
- displayOptions: { show: { operation: ['sendMediaGroup'], resource: ['message'] } },
- description: 'The media to add',
- placeholder: 'Add Media',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- displayName: 'Media',
- name: 'media',
- values: [
- {
- displayName: 'Type',
- name: 'type',
- type: 'options',
- options: [
- { name: 'Photo', value: 'photo' },
- { name: 'Video', value: 'video' },
- ],
- default: 'photo',
- description: 'The type of the media to add',
- },
- {
- displayName: 'Media File',
- name: 'media',
- type: 'string',
- default: '',
- description:
- 'Media to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- options: [
- {
- displayName: 'Caption',
- name: 'caption',
- type: 'string',
- default: '',
- description: 'Caption text to set, 0-1024 characters',
- },
- {
- displayName: 'Parse Mode',
- name: 'parse_mode',
- type: 'options',
- options: [
- { name: 'Markdown (Legacy)', value: 'Markdown' },
- { name: 'MarkdownV2', value: 'MarkdownV2' },
- { name: 'HTML', value: 'HTML' },
- ],
- default: 'HTML',
- description: 'How to parse the text',
- },
- ],
- },
- ],
- },
- ],
- },
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- required: true,
- default: '',
- displayOptions: {
- show: { operation: ['editMessageText', 'sendMessage'], resource: ['message'] },
- },
- description: 'Text of the message to be sent',
- },
- {
- displayName: 'Photo',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendPhoto'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Photo to send. Pass a file_id to send a photo that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a photo from the Internet.',
- },
- {
- displayName: 'Sticker',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendSticker'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Sticker to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a .webp file from the Internet.',
- },
- {
- displayName: 'Video',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendVideo'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Video file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Reply Markup',
- name: 'replyMarkup',
- displayOptions: {
- show: {
- operation: [
- 'sendAnimation',
- 'sendDocument',
- 'sendMessage',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- 'sendAudio',
- 'sendLocation',
- ],
- resource: ['message'],
- },
- },
- type: 'options',
- options: [
- { name: 'Force Reply', value: 'forceReply' },
- { name: 'Inline Keyboard', value: 'inlineKeyboard' },
- { name: 'None', value: 'none' },
- { name: 'Reply Keyboard', value: 'replyKeyboard' },
- { name: 'Reply Keyboard Remove', value: 'replyKeyboardRemove' },
- ],
- default: 'none',
- description: 'Additional interface options',
- },
- {
- displayName: 'Force Reply',
- name: 'forceReply',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { replyMarkup: ['forceReply'], resource: ['message'] } },
- default: {},
- options: [
- {
- displayName: 'Force Reply',
- name: 'force_reply',
- type: 'boolean',
- default: false,
- description:
- 'Whether to show reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply',
- },
- {
- displayName: 'Selective',
- name: 'selective',
- type: 'boolean',
- default: false,
- description: 'Whether to force reply from specific users only',
- },
- ],
- },
- {
- displayName: 'Inline Keyboard',
- name: 'inlineKeyboard',
- placeholder: 'Add Keyboard Row',
- description: 'Adds an inline keyboard that appears right next to the message it belongs to',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: { show: { replyMarkup: ['inlineKeyboard'], resource: ['message'] } },
- default: {},
- options: [
- {
- displayName: 'Rows',
- name: 'rows',
- values: [
- {
- displayName: 'Row',
- name: 'row',
- type: 'fixedCollection',
- description: 'The value to set',
- placeholder: 'Add Button',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- displayName: 'Buttons',
- name: 'buttons',
- values: [
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description: 'Label text on the button',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- options: [
- {
- displayName: 'Callback Data',
- name: 'callback_data',
- type: 'string',
- default: '',
- description:
- 'Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes',
- },
- {
- displayName: 'Pay',
- name: 'pay',
- type: 'boolean',
- default: false,
- description: 'Whether to send a Pay button',
- },
- {
- displayName: 'Switch Inline Query Current Chat',
- name: 'switch_inline_query_current_chat',
- type: 'string',
- default: '',
- description:
- "If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field.Can be empty, in which case only the bot’s username will be inserted",
- },
- {
- displayName: 'Switch Inline Query',
- name: 'switch_inline_query',
- type: 'string',
- default: '',
- description:
- 'If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.',
- },
- {
- displayName: 'URL',
- name: 'url',
- type: 'string',
- default: '',
- description: 'HTTP or tg:// URL to be opened when button is pressed',
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- {
- displayName: 'Reply Keyboard',
- name: 'replyKeyboard',
- placeholder: 'Add Reply Keyboard Row',
- description: 'Adds a custom keyboard with reply options',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: { show: { replyMarkup: ['replyKeyboard'] } },
- default: {},
- options: [
- {
- displayName: 'Rows',
- name: 'rows',
- values: [
- {
- displayName: 'Row',
- name: 'row',
- type: 'fixedCollection',
- description: 'The value to set',
- placeholder: 'Add Button',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- displayName: 'Buttons',
- name: 'buttons',
- values: [
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description:
- 'Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- options: [
- {
- displayName: 'Request Contact',
- name: 'request_contact',
- type: 'boolean',
- default: false,
- description:
- "Whether the user's phone number will be sent as a contact when the button is pressed.Available in private chats only",
- },
- {
- displayName: 'Request Location',
- name: 'request_location',
- type: 'boolean',
- default: false,
- description: "Whether the user's request_location",
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- {
- displayName: 'Reply Keyboard Options',
- name: 'replyKeyboardOptions',
- type: 'collection',
- placeholder: 'Add Option',
- displayOptions: { show: { replyMarkup: ['replyKeyboard'] } },
- default: {},
- options: [
- {
- displayName: 'Resize Keyboard',
- name: 'resize_keyboard',
- type: 'boolean',
- default: false,
- description:
- 'Whether to request clients to resize the keyboard vertically for optimal fit',
- },
- {
- displayName: 'One Time Keyboard',
- name: 'one_time_keyboard',
- type: 'boolean',
- default: false,
- description: "Whether to request clients to hide the keyboard as soon as it's been used",
- },
- {
- displayName: 'Selective',
- name: 'selective',
- type: 'boolean',
- default: false,
- description: 'Whether to show the keyboard to specific users only',
- },
- ],
- },
- {
- displayName: 'Reply Keyboard Remove',
- name: 'replyKeyboardRemove',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { replyMarkup: ['replyKeyboardRemove'] } },
- default: {},
- options: [
- {
- displayName: 'Remove Keyboard',
- name: 'remove_keyboard',
- type: 'boolean',
- default: false,
- description: 'Whether to request clients to remove the custom keyboard',
- },
- {
- displayName: 'Selective',
- name: 'selective',
- type: 'boolean',
- default: false,
- description: 'Whether to force reply from specific users only',
- },
- ],
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: {
- show: {
- operation: [
- 'editMessageText',
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendLocation',
- 'sendMessage',
- 'sendMediaGroup',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- ],
- resource: ['message'],
- },
- },
- default: {},
- options: [
- {
- displayName: 'Append n8n Attribution',
- name: 'appendAttribution',
- type: 'boolean',
- default: true,
- description:
- 'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
- displayOptions: { show: { '/operation': ['sendMessage'] } },
- },
- {
- displayName: 'Caption',
- name: 'caption',
- type: 'string',
- displayOptions: {
- show: {
- '/operation': [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- ],
- },
- },
- default: '',
- description: 'Caption text to set, 0-1024 characters',
- },
- {
- displayName: 'Disable Notification',
- name: 'disable_notification',
- type: 'boolean',
- default: false,
- displayOptions: { hide: { '/operation': ['editMessageText'] } },
- description:
- 'Whether to send the message silently. Users will receive a notification with no sound.',
- },
- {
- displayName: 'Disable WebPage Preview',
- name: 'disable_web_page_preview',
- type: 'boolean',
- displayOptions: { show: { '/operation': ['editMessageText', 'sendMessage'] } },
- default: false,
- description: 'Whether to disable link previews for links in this message',
- },
- {
- displayName: 'Duration',
- name: 'duration',
- type: 'number',
- typeOptions: { minValue: 0 },
- displayOptions: { show: { '/operation': ['sendAnimation', 'sendAudio', 'sendVideo'] } },
- default: 0,
- description: 'Duration of clip in seconds',
- },
- {
- displayName: 'File Name',
- name: 'fileName',
- type: 'string',
- default: '',
- displayOptions: {
- show: {
- '/operation': [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- 'sendSticker',
- ],
- '/resource': ['message'],
- '/binaryData': [true],
- },
- },
- placeholder: 'image.jpeg',
- },
- {
- displayName: 'Height',
- name: 'height',
- type: 'number',
- typeOptions: { minValue: 0 },
- displayOptions: { show: { '/operation': ['sendAnimation', 'sendVideo'] } },
- default: 0,
- description: 'Height of the video',
- },
- {
- displayName: 'Parse Mode',
- name: 'parse_mode',
- type: 'options',
- options: [
- { name: 'Markdown (Legacy)', value: 'Markdown' },
- { name: 'MarkdownV2', value: 'MarkdownV2' },
- { name: 'HTML', value: 'HTML' },
- ],
- displayOptions: {
- show: {
- '/operation': [
- 'editMessageText',
- 'sendAnimation',
- 'sendAudio',
- 'sendMessage',
- 'sendPhoto',
- 'sendVideo',
- 'sendDocument',
- ],
- },
- },
- default: 'HTML',
- description: 'How to parse the text',
- },
- {
- displayName: 'Performer',
- name: 'performer',
- type: 'string',
- displayOptions: { show: { '/operation': ['sendAudio'] } },
- default: '',
- description: 'Name of the performer',
- },
- {
- displayName: 'Reply To Message ID',
- name: 'reply_to_message_id',
- type: 'number',
- displayOptions: { hide: { '/operation': ['editMessageText'] } },
- default: 0,
- description: 'If the message is a reply, ID of the original message',
- },
- {
- displayName: 'Message Thread ID',
- name: 'message_thread_id',
- type: 'number',
- displayOptions: {
- show: {
- '/operation': [
- 'sendAnimation',
- 'sendAudio',
- 'sendChatAction',
- 'sendDocument',
- 'sendLocation',
- 'sendMediaGroup',
- 'sendMessage',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- ],
- },
- },
- default: 0,
- description: 'The unique identifier of the forum topic',
- },
- {
- displayName: 'Title',
- name: 'title',
- type: 'string',
- displayOptions: { show: { '/operation': ['sendAudio'] } },
- default: '',
- description: 'Title of the track',
- },
- {
- displayName: 'Thumbnail',
- name: 'thumb',
- type: 'string',
- displayOptions: {
- show: { '/operation': ['sendAnimation', 'sendAudio', 'sendDocument', 'sendVideo'] },
- },
- default: '',
- description:
- 'Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320.',
- },
- {
- displayName: 'Width',
- name: 'width',
- type: 'number',
- typeOptions: { minValue: 0 },
- displayOptions: { show: { '/operation': ['sendAnimation', 'sendVideo'] } },
- default: 0,
- description: 'Width of the video',
- },
- ],
- },
- ],
- codex: {
- categories: ['Communication'],
- resources: {
- primaryDocumentation: [
- { url: 'https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/' },
- ],
- credentialDocumentation: [{ url: 'https://docs.n8n.io/credentials/telegram' }],
- },
- },
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/Telegram/telegram.svg',
-} satisfies INodeTypeDescription;
-
-export const nodeTypeTelegramV1_1 = {
- displayName: 'Telegram',
- name: 'n8n-nodes-base.telegram',
- group: ['output'],
- version: [1, 1.1],
- subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
- description: 'Sends data to Telegram',
- defaults: { name: 'Telegram' },
- inputs: ['main'],
- outputs: ['main'],
- credentials: [{ name: 'telegramApi', required: true }],
- properties: [
- {
- displayName: 'Resource',
- name: 'resource',
- type: 'options',
- noDataExpression: true,
- options: [
- { name: 'Chat', value: 'chat' },
- { name: 'Callback', value: 'callback' },
- { name: 'File', value: 'file' },
- { name: 'Message', value: 'message' },
- ],
- default: 'message',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['chat'] } },
- options: [
- {
- name: 'Get',
- value: 'get',
- description: 'Get up to date information about a chat',
- action: 'Get a chat',
- },
- {
- name: 'Get Administrators',
- value: 'administrators',
- description: 'Get the Administrators of a chat',
- action: 'Get all administrators in a chat',
- },
- {
- name: 'Get Member',
- value: 'member',
- description: 'Get the member of a chat',
- action: 'Get a member in a chat',
- },
- {
- name: 'Leave',
- value: 'leave',
- description: 'Leave a group, supergroup or channel',
- action: 'Leave a chat',
- },
- {
- name: 'Set Description',
- value: 'setDescription',
- description: 'Set the description of a chat',
- action: 'Set description on a chat',
- },
- {
- name: 'Set Title',
- value: 'setTitle',
- description: 'Set the title of a chat',
- action: 'Set a title on a chat',
- },
- ],
- default: 'get',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['callback'] } },
- options: [
- {
- name: 'Answer Query',
- value: 'answerQuery',
- description: 'Send answer to callback query sent from inline keyboard',
- action: 'Answer Query a callback',
- },
- {
- name: 'Answer Inline Query',
- value: 'answerInlineQuery',
- description: 'Send answer to callback query sent from inline bot',
- action: 'Answer an inline query callback',
- },
- ],
- default: 'answerQuery',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['file'] } },
- options: [{ name: 'Get', value: 'get', description: 'Get a file', action: 'Get a file' }],
- default: 'get',
- },
- {
- displayName: 'Operation',
- name: 'operation',
- type: 'options',
- noDataExpression: true,
- displayOptions: { show: { resource: ['message'] } },
- options: [
- {
- name: 'Delete Chat Message',
- value: 'deleteMessage',
- description: 'Delete a chat message',
- action: 'Delete a chat message',
- },
- {
- name: 'Edit Message Text',
- value: 'editMessageText',
- description: 'Edit a text message',
- action: 'Edit a test message',
- },
- {
- name: 'Pin Chat Message',
- value: 'pinChatMessage',
- description: 'Pin a chat message',
- action: 'Pin a chat message',
- },
- {
- name: 'Send Animation',
- value: 'sendAnimation',
- description: 'Send an animated file',
- action: 'Send an animated file',
- },
- {
- name: 'Send Audio',
- value: 'sendAudio',
- description: 'Send a audio file',
- action: 'Send an audio file',
- },
- {
- name: 'Send Chat Action',
- value: 'sendChatAction',
- description: 'Send a chat action',
- action: 'Send a chat action',
- },
- {
- name: 'Send Document',
- value: 'sendDocument',
- description: 'Send a document',
- action: 'Send a document',
- },
- {
- name: 'Send Location',
- value: 'sendLocation',
- description: 'Send a location',
- action: 'Send a location',
- },
- {
- name: 'Send Media Group',
- value: 'sendMediaGroup',
- description: 'Send group of photos or videos to album',
- action: 'Send a media group message',
- },
- {
- name: 'Send Message',
- value: 'sendMessage',
- description: 'Send a text message',
- action: 'Send a text message',
- },
- {
- name: 'Send Photo',
- value: 'sendPhoto',
- description: 'Send a photo',
- action: 'Send a photo message',
- },
- {
- name: 'Send Sticker',
- value: 'sendSticker',
- description: 'Send a sticker',
- action: 'Send a sticker',
- },
- {
- name: 'Send Video',
- value: 'sendVideo',
- description: 'Send a video',
- action: 'Send a video',
- },
- {
- name: 'Unpin Chat Message',
- value: 'unpinChatMessage',
- description: 'Unpin a chat message',
- action: 'Unpin a chat message',
- },
- ],
- default: 'sendMessage',
- },
- {
- displayName: 'Chat ID',
- name: 'chatId',
- type: 'string',
- default: '',
- displayOptions: {
- show: {
- operation: [
- 'administrators',
- 'deleteMessage',
- 'get',
- 'leave',
- 'member',
- 'pinChatMessage',
- 'setDescription',
- 'setTitle',
- 'sendAnimation',
- 'sendAudio',
- 'sendChatAction',
- 'sendDocument',
- 'sendLocation',
- 'sendMessage',
- 'sendMediaGroup',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- 'unpinChatMessage',
- ],
- resource: ['chat', 'message'],
- },
- },
- required: true,
- description:
- 'Unique identifier for the target chat or username of the target channel (in the format @channelusername)',
- },
- {
- displayName: 'Message ID',
- name: 'messageId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['deleteMessage'], resource: ['message'] } },
- required: true,
- description: 'Unique identifier of the message to delete',
- },
- {
- displayName: 'Message ID',
- name: 'messageId',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['pinChatMessage', 'unpinChatMessage'], resource: ['message'] },
- },
- required: true,
- description: 'Unique identifier of the message to pin or unpin',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { operation: ['pinChatMessage'], resource: ['message'] } },
- default: {},
- options: [
- {
- displayName: 'Disable Notification',
- name: 'disable_notification',
- type: 'boolean',
- default: false,
- description:
- 'Whether to send a notification to all chat members about the new pinned message',
- },
- ],
- },
- {
- displayName: 'User ID',
- name: 'userId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['member'], resource: ['chat'] } },
- required: true,
- description: 'Unique identifier of the target user',
- },
- {
- displayName: 'Description',
- name: 'description',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['setDescription'], resource: ['chat'] } },
- required: true,
- description: 'New chat description, 0-255 characters',
- },
- {
- displayName: 'Title',
- name: 'title',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['setTitle'], resource: ['chat'] } },
- required: true,
- description: 'New chat title, 1-255 characters',
- },
- {
- displayName: 'Query ID',
- name: 'queryId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['answerQuery'], resource: ['callback'] } },
- required: true,
- description: 'Unique identifier for the query to be answered',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { operation: ['answerQuery'], resource: ['callback'] } },
- default: {},
- options: [
- {
- displayName: 'Cache Time',
- name: 'cache_time',
- type: 'number',
- typeOptions: { minValue: 0 },
- default: 0,
- description:
- 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
- },
- {
- displayName: 'Show Alert',
- name: 'show_alert',
- type: 'boolean',
- default: false,
- description:
- 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
- },
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description:
- 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
- },
- {
- displayName: 'URL',
- name: 'url',
- type: 'string',
- default: '',
- description: "URL that will be opened by the user's client",
- },
- ],
- },
- {
- displayName: 'Query ID',
- name: 'queryId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['answerInlineQuery'], resource: ['callback'] } },
- required: true,
- description: 'Unique identifier for the answered query',
- },
- {
- displayName: 'Results',
- name: 'results',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['answerInlineQuery'], resource: ['callback'] } },
- required: true,
- description: 'A JSON-serialized array of results for the inline query',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { operation: ['answerInlineQuery'], resource: ['callback'] } },
- default: {},
- options: [
- {
- displayName: 'Cache Time',
- name: 'cache_time',
- type: 'number',
- typeOptions: { minValue: 0 },
- default: 0,
- description:
- 'The maximum amount of time in seconds that the result of the callback query may be cached client-side',
- },
- {
- displayName: 'Show Alert',
- name: 'show_alert',
- type: 'boolean',
- default: false,
- description:
- 'Whether an alert will be shown by the client instead of a notification at the top of the chat screen',
- },
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description:
- 'Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters.',
- },
- {
- displayName: 'URL',
- name: 'url',
- type: 'string',
- default: '',
- description: "URL that will be opened by the user's client",
- },
- ],
- },
- {
- displayName: 'File ID',
- name: 'fileId',
- type: 'string',
- default: '',
- displayOptions: { show: { operation: ['get'], resource: ['file'] } },
- required: true,
- description: 'The ID of the file',
- },
- {
- displayName: 'Download',
- name: 'download',
- type: 'boolean',
- displayOptions: { show: { operation: ['get'], resource: ['file'] } },
- default: true,
- description: 'Whether to download the file',
- },
- {
- displayName: 'Message Type',
- name: 'messageType',
- type: 'options',
- displayOptions: { show: { operation: ['editMessageText'], resource: ['message'] } },
- options: [
- { name: 'Inline Message', value: 'inlineMessage' },
- { name: 'Message', value: 'message' },
- ],
- default: 'message',
- description: 'The type of the message to edit',
- },
- {
- displayName: 'Chat ID',
- name: 'chatId',
- type: 'string',
- default: '',
- displayOptions: {
- show: { messageType: ['message'], operation: ['editMessageText'], resource: ['message'] },
- },
- required: true,
- description:
- 'Unique identifier for the target chat or username of the target channel (in the format @channelusername). To find your chat ID ask @get_id_bot.',
- },
- {
- displayName: 'Binary Data',
- name: 'binaryData',
- type: 'boolean',
- default: false,
- required: true,
- displayOptions: {
- show: {
- operation: [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- 'sendSticker',
- ],
- resource: ['message'],
- },
- },
- description: 'Whether the data to upload should be taken from binary field',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- required: true,
- displayOptions: {
- show: {
- operation: [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- 'sendSticker',
- ],
- resource: ['message'],
- binaryData: [true],
- },
- },
- placeholder: '',
- description: 'Name of the binary property that contains the data to upload',
- },
- {
- displayName: 'Message ID',
- name: 'messageId',
- type: 'string',
- default: '',
- displayOptions: {
- show: { messageType: ['message'], operation: ['editMessageText'], resource: ['message'] },
- },
- required: true,
- description: 'Unique identifier of the message to edit',
- },
- {
- displayName: 'Inline Message ID',
- name: 'inlineMessageId',
- type: 'string',
- default: '',
- displayOptions: {
- show: {
- messageType: ['inlineMessage'],
- operation: ['editMessageText'],
- resource: ['message'],
- },
- },
- required: true,
- description: 'Unique identifier of the inline message to edit',
- },
- {
- displayName: 'Reply Markup',
- name: 'replyMarkup',
- displayOptions: { show: { operation: ['editMessageText'], resource: ['message'] } },
- type: 'options',
- options: [
- { name: 'None', value: 'none' },
- { name: 'Inline Keyboard', value: 'inlineKeyboard' },
- ],
- default: 'none',
- description: 'Additional interface options',
- },
- {
- displayName: 'Animation',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendAnimation'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Animation to send. Pass a file_id to send an animation that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get an animation from the Internet.',
- },
- {
- displayName: 'Audio',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendAudio'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Audio file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Action',
- name: 'action',
- type: 'options',
- displayOptions: { show: { operation: ['sendChatAction'], resource: ['message'] } },
- options: [
- { name: 'Find Location', value: 'find_location', action: 'Find location' },
- { name: 'Record Audio', value: 'record_audio', action: 'Record audio' },
- { name: 'Record Video', value: 'record_video', action: 'Record video' },
- { name: 'Record Video Note', value: 'record_video_note', action: 'Record video note' },
- { name: 'Typing', value: 'typing', action: 'Typing a message' },
- { name: 'Upload Audio', value: 'upload_audio', action: 'Upload audio' },
- { name: 'Upload Document', value: 'upload_document', action: 'Upload document' },
- { name: 'Upload Photo', value: 'upload_photo', action: 'Upload photo' },
- { name: 'Upload Video', value: 'upload_video', action: 'Upload video' },
- { name: 'Upload Video Note', value: 'upload_video_note', action: 'Upload video note' },
- ],
- default: 'typing',
- description:
- 'Type of action to broadcast. Choose one, depending on what the user is about to receive. The status is set for 5 seconds or less (when a message arrives from your bot).',
- },
- {
- displayName: 'Document',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendDocument'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Document to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Latitude',
- name: 'latitude',
- type: 'number',
- default: 0,
- typeOptions: { numberPrecision: 10, minValue: -90, maxValue: 90 },
- displayOptions: { show: { operation: ['sendLocation'], resource: ['message'] } },
- description: 'Location latitude',
- },
- {
- displayName: 'Longitude',
- name: 'longitude',
- type: 'number',
- typeOptions: { numberPrecision: 10, minValue: -180, maxValue: 180 },
- default: 0,
- displayOptions: { show: { operation: ['sendLocation'], resource: ['message'] } },
- description: 'Location longitude',
- },
- {
- displayName: 'Media',
- name: 'media',
- type: 'fixedCollection',
- displayOptions: { show: { operation: ['sendMediaGroup'], resource: ['message'] } },
- description: 'The media to add',
- placeholder: 'Add Media',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- displayName: 'Media',
- name: 'media',
- values: [
- {
- displayName: 'Type',
- name: 'type',
- type: 'options',
- options: [
- { name: 'Photo', value: 'photo' },
- { name: 'Video', value: 'video' },
- ],
- default: 'photo',
- description: 'The type of the media to add',
- },
- {
- displayName: 'Media File',
- name: 'media',
- type: 'string',
- default: '',
- description:
- 'Media to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- options: [
- {
- displayName: 'Caption',
- name: 'caption',
- type: 'string',
- default: '',
- description: 'Caption text to set, 0-1024 characters',
- },
- {
- displayName: 'Parse Mode',
- name: 'parse_mode',
- type: 'options',
- options: [
- { name: 'Markdown (Legacy)', value: 'Markdown' },
- { name: 'MarkdownV2', value: 'MarkdownV2' },
- { name: 'HTML', value: 'HTML' },
- ],
- default: 'HTML',
- description: 'How to parse the text',
- },
- ],
- },
- ],
- },
- ],
- },
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- required: true,
- default: '',
- displayOptions: {
- show: { operation: ['editMessageText', 'sendMessage'], resource: ['message'] },
- },
- description: 'Text of the message to be sent',
- },
- {
- displayName: 'Photo',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendPhoto'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Photo to send. Pass a file_id to send a photo that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a photo from the Internet.',
- },
- {
- displayName: 'Sticker',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendSticker'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Sticker to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a .webp file from the Internet.',
- },
- {
- displayName: 'Video',
- name: 'file',
- type: 'string',
- default: '',
- displayOptions: {
- show: { operation: ['sendVideo'], resource: ['message'], binaryData: [false] },
- },
- description:
- 'Video file to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), an HTTP URL for Telegram to get a file from the Internet.',
- },
- {
- displayName: 'Reply Markup',
- name: 'replyMarkup',
- displayOptions: {
- show: {
- operation: [
- 'sendAnimation',
- 'sendDocument',
- 'sendMessage',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- 'sendAudio',
- 'sendLocation',
- ],
- resource: ['message'],
- },
- },
- type: 'options',
- options: [
- { name: 'Force Reply', value: 'forceReply' },
- { name: 'Inline Keyboard', value: 'inlineKeyboard' },
- { name: 'None', value: 'none' },
- { name: 'Reply Keyboard', value: 'replyKeyboard' },
- { name: 'Reply Keyboard Remove', value: 'replyKeyboardRemove' },
- ],
- default: 'none',
- description: 'Additional interface options',
- },
- {
- displayName: 'Force Reply',
- name: 'forceReply',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { replyMarkup: ['forceReply'], resource: ['message'] } },
- default: {},
- options: [
- {
- displayName: 'Force Reply',
- name: 'force_reply',
- type: 'boolean',
- default: false,
- description:
- 'Whether to show reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply',
- },
- {
- displayName: 'Selective',
- name: 'selective',
- type: 'boolean',
- default: false,
- description: 'Whether to force reply from specific users only',
- },
- ],
- },
- {
- displayName: 'Inline Keyboard',
- name: 'inlineKeyboard',
- placeholder: 'Add Keyboard Row',
- description: 'Adds an inline keyboard that appears right next to the message it belongs to',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: { show: { replyMarkup: ['inlineKeyboard'], resource: ['message'] } },
- default: {},
- options: [
- {
- displayName: 'Rows',
- name: 'rows',
- values: [
- {
- displayName: 'Row',
- name: 'row',
- type: 'fixedCollection',
- description: 'The value to set',
- placeholder: 'Add Button',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- displayName: 'Buttons',
- name: 'buttons',
- values: [
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description: 'Label text on the button',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- options: [
- {
- displayName: 'Callback Data',
- name: 'callback_data',
- type: 'string',
- default: '',
- description:
- 'Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes',
- },
- {
- displayName: 'Pay',
- name: 'pay',
- type: 'boolean',
- default: false,
- description: 'Whether to send a Pay button',
- },
- {
- displayName: 'Switch Inline Query Current Chat',
- name: 'switch_inline_query_current_chat',
- type: 'string',
- default: '',
- description:
- "If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field.Can be empty, in which case only the bot’s username will be inserted",
- },
- {
- displayName: 'Switch Inline Query',
- name: 'switch_inline_query',
- type: 'string',
- default: '',
- description:
- 'If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.',
- },
- {
- displayName: 'URL',
- name: 'url',
- type: 'string',
- default: '',
- description: 'HTTP or tg:// URL to be opened when button is pressed',
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- {
- displayName: 'Reply Keyboard',
- name: 'replyKeyboard',
- placeholder: 'Add Reply Keyboard Row',
- description: 'Adds a custom keyboard with reply options',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: { show: { replyMarkup: ['replyKeyboard'] } },
- default: {},
- options: [
- {
- displayName: 'Rows',
- name: 'rows',
- values: [
- {
- displayName: 'Row',
- name: 'row',
- type: 'fixedCollection',
- description: 'The value to set',
- placeholder: 'Add Button',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- displayName: 'Buttons',
- name: 'buttons',
- values: [
- {
- displayName: 'Text',
- name: 'text',
- type: 'string',
- default: '',
- description:
- 'Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.',
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- default: {},
- options: [
- {
- displayName: 'Request Contact',
- name: 'request_contact',
- type: 'boolean',
- default: false,
- description:
- "Whether the user's phone number will be sent as a contact when the button is pressed.Available in private chats only",
- },
- {
- displayName: 'Request Location',
- name: 'request_location',
- type: 'boolean',
- default: false,
- description: "Whether the user's request_location",
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- },
- {
- displayName: 'Reply Keyboard Options',
- name: 'replyKeyboardOptions',
- type: 'collection',
- placeholder: 'Add Option',
- displayOptions: { show: { replyMarkup: ['replyKeyboard'] } },
- default: {},
- options: [
- {
- displayName: 'Resize Keyboard',
- name: 'resize_keyboard',
- type: 'boolean',
- default: false,
- description:
- 'Whether to request clients to resize the keyboard vertically for optimal fit',
- },
- {
- displayName: 'One Time Keyboard',
- name: 'one_time_keyboard',
- type: 'boolean',
- default: false,
- description: "Whether to request clients to hide the keyboard as soon as it's been used",
- },
- {
- displayName: 'Selective',
- name: 'selective',
- type: 'boolean',
- default: false,
- description: 'Whether to show the keyboard to specific users only',
- },
- ],
- },
- {
- displayName: 'Reply Keyboard Remove',
- name: 'replyKeyboardRemove',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: { show: { replyMarkup: ['replyKeyboardRemove'] } },
- default: {},
- options: [
- {
- displayName: 'Remove Keyboard',
- name: 'remove_keyboard',
- type: 'boolean',
- default: false,
- description: 'Whether to request clients to remove the custom keyboard',
- },
- {
- displayName: 'Selective',
- name: 'selective',
- type: 'boolean',
- default: false,
- description: 'Whether to force reply from specific users only',
- },
- ],
- },
- {
- displayName: 'Additional Fields',
- name: 'additionalFields',
- type: 'collection',
- placeholder: 'Add Field',
- displayOptions: {
- show: {
- operation: [
- 'editMessageText',
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendLocation',
- 'sendMessage',
- 'sendMediaGroup',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- ],
- resource: ['message'],
- },
- },
- default: {},
- options: [
- {
- displayName: 'Append n8n Attribution',
- name: 'appendAttribution',
- type: 'boolean',
- default: true,
- description:
- 'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
- displayOptions: { show: { '/operation': ['sendMessage'] } },
- },
- {
- displayName: 'Caption',
- name: 'caption',
- type: 'string',
- displayOptions: {
- show: {
- '/operation': [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- ],
- },
- },
- default: '',
- description: 'Caption text to set, 0-1024 characters',
- },
- {
- displayName: 'Disable Notification',
- name: 'disable_notification',
- type: 'boolean',
- default: false,
- displayOptions: { hide: { '/operation': ['editMessageText'] } },
- description:
- 'Whether to send the message silently. Users will receive a notification with no sound.',
- },
- {
- displayName: 'Disable WebPage Preview',
- name: 'disable_web_page_preview',
- type: 'boolean',
- displayOptions: { show: { '/operation': ['editMessageText', 'sendMessage'] } },
- default: false,
- description: 'Whether to disable link previews for links in this message',
- },
- {
- displayName: 'Duration',
- name: 'duration',
- type: 'number',
- typeOptions: { minValue: 0 },
- displayOptions: { show: { '/operation': ['sendAnimation', 'sendAudio', 'sendVideo'] } },
- default: 0,
- description: 'Duration of clip in seconds',
- },
- {
- displayName: 'File Name',
- name: 'fileName',
- type: 'string',
- default: '',
- displayOptions: {
- show: {
- '/operation': [
- 'sendAnimation',
- 'sendAudio',
- 'sendDocument',
- 'sendPhoto',
- 'sendVideo',
- 'sendSticker',
- ],
- '/resource': ['message'],
- '/binaryData': [true],
- },
- },
- placeholder: 'image.jpeg',
- },
- {
- displayName: 'Height',
- name: 'height',
- type: 'number',
- typeOptions: { minValue: 0 },
- displayOptions: { show: { '/operation': ['sendAnimation', 'sendVideo'] } },
- default: 0,
- description: 'Height of the video',
- },
- {
- displayName: 'Parse Mode',
- name: 'parse_mode',
- type: 'options',
- options: [
- { name: 'Markdown (Legacy)', value: 'Markdown' },
- { name: 'MarkdownV2', value: 'MarkdownV2' },
- { name: 'HTML', value: 'HTML' },
- ],
- displayOptions: {
- show: {
- '/operation': [
- 'editMessageText',
- 'sendAnimation',
- 'sendAudio',
- 'sendMessage',
- 'sendPhoto',
- 'sendVideo',
- 'sendDocument',
- ],
- },
- },
- default: 'HTML',
- description: 'How to parse the text',
- },
- {
- displayName: 'Performer',
- name: 'performer',
- type: 'string',
- displayOptions: { show: { '/operation': ['sendAudio'] } },
- default: '',
- description: 'Name of the performer',
- },
- {
- displayName: 'Reply To Message ID',
- name: 'reply_to_message_id',
- type: 'number',
- displayOptions: { hide: { '/operation': ['editMessageText'] } },
- default: 0,
- description: 'If the message is a reply, ID of the original message',
- },
- {
- displayName: 'Message Thread ID',
- name: 'message_thread_id',
- type: 'number',
- displayOptions: {
- show: {
- '/operation': [
- 'sendAnimation',
- 'sendAudio',
- 'sendChatAction',
- 'sendDocument',
- 'sendLocation',
- 'sendMediaGroup',
- 'sendMessage',
- 'sendPhoto',
- 'sendSticker',
- 'sendVideo',
- ],
- },
- },
- default: 0,
- description: 'The unique identifier of the forum topic',
- },
- {
- displayName: 'Title',
- name: 'title',
- type: 'string',
- displayOptions: { show: { '/operation': ['sendAudio'] } },
- default: '',
- description: 'Title of the track',
- },
- {
- displayName: 'Thumbnail',
- name: 'thumb',
- type: 'string',
- displayOptions: {
- show: { '/operation': ['sendAnimation', 'sendAudio', 'sendDocument', 'sendVideo'] },
- },
- default: '',
- description:
- 'Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320.',
- },
- {
- displayName: 'Width',
- name: 'width',
- type: 'number',
- typeOptions: { minValue: 0 },
- displayOptions: { show: { '/operation': ['sendAnimation', 'sendVideo'] } },
- default: 0,
- description: 'Width of the video',
- },
- ],
- },
- ],
- codex: {
- categories: ['Communication'],
- resources: {
- primaryDocumentation: [
- { url: 'https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/' },
- ],
- credentialDocumentation: [{ url: 'https://docs.n8n.io/credentials/telegram' }],
- },
- },
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/Telegram/telegram.svg',
-} satisfies INodeTypeDescription;
+ credentials: [{ name: 'twitterOAuth1Api' }],
+ properties: [],
+});
-export const nodeTypeShopifyTriggerV1 = {
- displayName: 'Shopify Trigger',
- name: 'n8n-nodes-base.shopifyTrigger',
- group: ['trigger'],
+export const nodeTypeReadImap = mock"sendKey1:binaryProperty1,sendKey2:binaryProperty2
',
- },
- {
- displayName: 'Body Parameters',
- name: 'bodyParametersJson',
- type: 'json',
- displayOptions: {
- hide: { sendBinaryData: [true] },
- show: { jsonParameters: [true], requestMethod: ['PATCH', 'POST', 'PUT', 'DELETE'] },
- },
- default: '',
- description: 'Body parameters as JSON or RAW',
- },
- {
- displayName: 'Body Parameters',
- name: 'bodyParametersUi',
- placeholder: 'Add Parameter',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: {
- show: { jsonParameters: [false], requestMethod: ['PATCH', 'POST', 'PUT', 'DELETE'] },
- },
- description: 'The body parameter to send',
- default: {},
- options: [
- {
- name: 'parameter',
- displayName: 'Parameter',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: '',
- description: 'Name of the parameter',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value of the parameter',
- },
- ],
- },
- ],
- },
- {
- displayName: 'Headers',
- name: 'headerParametersJson',
- type: 'json',
- displayOptions: { show: { jsonParameters: [true] } },
- default: '',
- description: 'Header parameters as JSON or RAW',
- },
- {
- displayName: 'Headers',
- name: 'headerParametersUi',
- placeholder: 'Add Header',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: { show: { jsonParameters: [false] } },
- description: 'The headers to send',
- default: {},
- options: [
- {
- name: 'parameter',
- displayName: 'Header',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: '',
- description: 'Name of the header',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value to set for the header',
- },
- ],
- },
- ],
- },
- {
- displayName: 'Query Parameters',
- name: 'queryParametersJson',
- type: 'json',
- displayOptions: { show: { jsonParameters: [true] } },
- default: '',
- description: 'Query parameters as JSON (flat object)',
- },
- {
- displayName: 'Query Parameters',
- name: 'queryParametersUi',
- placeholder: 'Add Parameter',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- displayOptions: { show: { jsonParameters: [false] } },
- description: 'The query parameter to send',
- default: {},
- options: [
- {
- name: 'parameter',
- displayName: 'Parameter',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: '',
- description: 'Name of the parameter',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value of the parameter',
- },
- ],
- },
- ],
- },
- {
- displayName:
- "You can view the raw requests this node makes in your browser's developer console",
- name: 'infoMessage',
- type: 'notice',
- default: '',
- },
- ],
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/HttpRequest/httprequest.svg',
- codex: {
- categories: ['Development', 'Core Nodes'],
- subcategories: { 'Core Nodes': ['Helpers'] },
- resources: {
- primaryDocumentation: [
- {
- url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/',
- },
- ],
- },
- alias: ['API', 'Request', 'URL', 'Build', 'cURL'],
- },
-} satisfies INodeTypeDescription;
-
-export const nodeTypeRespondToWebhookV1 = {
- displayName: 'Respond to Webhook',
- name: 'n8n-nodes-base.respondToWebhook',
- group: ['transform'],
- version: 1,
- description: 'Returns data for Webhook',
- defaults: { name: 'Respond to Webhook' },
- inputs: ['main'],
- outputs: ['main'],
- credentials: [],
- properties: [
- {
- displayName:
- 'Verify that the "Webhook" node\'s "Respond" parameter is set to "Using Respond to Webhook Node". More details',
- name: 'generalNotice',
- type: 'notice',
- default: '',
- },
- {
- displayName: 'Respond With',
- name: 'respondWith',
- type: 'options',
- options: [
- {
- name: 'All Incoming Items',
- value: 'allIncomingItems',
- description: 'Respond with all input JSON items',
- },
- {
- name: 'Binary File',
- value: 'binary',
- description: 'Respond with incoming file binary data',
- },
- {
- name: 'First Incoming Item',
- value: 'firstIncomingItem',
- description: 'Respond with the first input JSON item',
- },
- { name: 'JSON', value: 'json', description: 'Respond with a custom JSON body' },
- { name: 'No Data', value: 'noData', description: 'Respond with an empty body' },
- {
- name: 'Redirect',
- value: 'redirect',
- description: 'Respond with a redirect to a given URL',
- },
- { name: 'Text', value: 'text', description: 'Respond with a simple text message body' },
- ],
- default: 'firstIncomingItem',
- description: 'The data that should be returned',
- },
- {
- displayName:
- 'When using expressions, note that this node will only run for the first item in the input data',
- name: 'webhookNotice',
- type: 'notice',
- displayOptions: { show: { respondWith: ['json', 'text'] } },
- default: '',
- },
- {
- displayName: 'Redirect URL',
- name: 'redirectURL',
- type: 'string',
- required: true,
- displayOptions: { show: { respondWith: ['redirect'] } },
- default: '',
- placeholder: 'e.g. http://www.n8n.io',
- description: 'The URL to redirect to',
- validateType: 'url',
- },
- {
- displayName: 'Response Body',
- name: 'responseBody',
- type: 'json',
- displayOptions: { show: { respondWith: ['json'] } },
- default: '{\n "myField": "value"\n}',
- typeOptions: { rows: 4 },
- description: 'The HTTP response JSON data',
- },
- {
- displayName: 'Response Body',
- name: 'responseBody',
- type: 'string',
- displayOptions: { show: { respondWith: ['text'] } },
- typeOptions: { rows: 2 },
- default: '',
- placeholder: 'e.g. Workflow completed',
- description: 'The HTTP response text data',
- },
- {
- displayName: 'Response Data Source',
- name: 'responseDataSource',
- type: 'options',
- displayOptions: { show: { respondWith: ['binary'] } },
- options: [
- {
- name: 'Choose Automatically From Input',
- value: 'automatically',
- description: 'Use if input data will contain a single piece of binary data',
- },
- {
- name: 'Specify Myself',
- value: 'set',
- description: 'Enter the name of the input field the binary data will be in',
- },
- ],
- default: 'automatically',
- },
- {
- displayName: 'Input Field Name',
- name: 'inputFieldName',
- type: 'string',
- required: true,
- default: 'data',
- displayOptions: { show: { respondWith: ['binary'], responseDataSource: ['set'] } },
- description: 'The name of the node input field with the binary data',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- options: [
- {
- displayName: 'Response Code',
- name: 'responseCode',
- type: 'number',
- typeOptions: { minValue: 100, maxValue: 599 },
- default: 200,
- description: 'The HTTP response code to return. Defaults to 200.',
- },
- {
- displayName: 'Response Headers',
- name: 'responseHeaders',
- placeholder: 'Add Response Header',
- description: 'Add headers to the webhook response',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- name: 'entries',
- displayName: 'Entries',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: '',
- description: 'Name of the header',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value of the header',
- },
- ],
- },
- ],
- },
- {
- displayName: 'Put Response in Field',
- name: 'responseKey',
- type: 'string',
- displayOptions: { show: { '/respondWith': ['allIncomingItems', 'firstIncomingItem'] } },
- default: '',
- description: 'The name of the response field to put all items in',
- placeholder: 'e.g. data',
- },
- ],
- },
- ],
- codex: {
- categories: ['Core Nodes', 'Utility'],
- subcategories: { 'Core Nodes': ['Helpers'] },
- resources: {
- primaryDocumentation: [
- {
- url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/',
- },
- ],
- },
- },
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/RespondToWebhook/webhook.svg',
-} satisfies INodeTypeDescription;
-
-export const nodeTypeWebhookV1 = {
- displayName: 'Webhook',
- name: 'n8n-nodes-base.webhook',
- group: ['trigger'],
- version: [1, 1.1],
- description: 'Starts the workflow when a webhook is called',
- eventTriggerDescription: 'Waiting for you to call the Test URL',
- activationMessage: 'You can now make calls to your production webhook URL.',
- defaults: { name: 'Webhook' },
- supportsCORS: true,
- triggerPanel: {
- header: '',
- executionsHelp: {
- inactive:
- 'Webhooks have two modes: test and production.
Use test mode while you build your workflow. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.
Use production mode to run your workflow automatically. Activate the workflow, then make requests to the production URL. These executions will show up in the executions list, but not in the editor.',
- active:
- 'Webhooks have two modes: test and production.
Use test mode while you build your workflow. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.
Use production mode to run your workflow automatically. Since the workflow is activated, you can make requests to the production URL. These executions will show up in the executions list, but not in the editor.',
- },
- activationHint:
- 'Once you’ve finished building your workflow, run it without having to click this button by using the production webhook URL.',
- },
- inputs: [],
- outputs: ['main'],
- credentials: [
- {
- name: 'httpBasicAuth',
- required: true,
- displayOptions: { show: { authentication: ['basicAuth'] } },
- },
- {
- name: 'httpHeaderAuth',
- required: true,
- displayOptions: { show: { authentication: ['headerAuth'] } },
- },
- ],
- webhooks: [
- {
- name: 'default',
- httpMethod: '={{$parameter["httpMethod"] || "GET"}}',
- isFullPath: true,
- responseCode: '={{$parameter["responseCode"]}}',
- responseMode: '={{$parameter["responseMode"]}}',
- responseData:
- '={{$parameter["responseData"] || ($parameter.options.noResponseBody ? "noData" : undefined) }}',
- responseBinaryPropertyName: '={{$parameter["responseBinaryPropertyName"]}}',
- responseContentType: '={{$parameter["options"]["responseContentType"]}}',
- responsePropertyName: '={{$parameter["options"]["responsePropertyName"]}}',
- responseHeaders: '={{$parameter["options"]["responseHeaders"]}}',
- path: '={{$parameter["path"]}}',
- },
- ],
- properties: [
- {
- displayName: 'Authentication',
- name: 'authentication',
- type: 'options',
- options: [
- { name: 'Basic Auth', value: 'basicAuth' },
- { name: 'Header Auth', value: 'headerAuth' },
- { name: 'None', value: 'none' },
- ],
- default: 'none',
- description: 'The way to authenticate',
- },
- {
- displayName: 'HTTP Method',
- name: 'httpMethod',
- type: 'options',
- options: [
- { name: 'DELETE', value: 'DELETE' },
- { name: 'GET', value: 'GET' },
- { name: 'HEAD', value: 'HEAD' },
- { name: 'PATCH', value: 'PATCH' },
- { name: 'POST', value: 'POST' },
- { name: 'PUT', value: 'PUT' },
- ],
- default: 'GET',
- description: 'The HTTP method to listen to',
- },
- {
- displayName: 'Path',
- name: 'path',
- type: 'string',
- default: '',
- placeholder: 'webhook',
- required: true,
- description: 'The path to listen to',
- },
- {
- displayName: 'Respond',
- name: 'responseMode',
- type: 'options',
- options: [
- {
- name: 'Immediately',
- value: 'onReceived',
- description: 'As soon as this node executes',
- },
- {
- name: 'When Last Node Finishes',
- value: 'lastNode',
- description: 'Returns data of the last-executed node',
- },
- {
- name: "Using 'Respond to Webhook' Node",
- value: 'responseNode',
- description: 'Response defined in that node',
- },
- ],
- default: 'onReceived',
- description: 'When and how to respond to the webhook',
- },
- {
- displayName:
- 'Insert a \'Respond to Webhook\' node to control when and how you respond. More details',
- name: 'webhookNotice',
- type: 'notice',
- displayOptions: { show: { responseMode: ['responseNode'] } },
- default: '',
- },
- {
- displayName: 'Response Code',
- name: 'responseCode',
- type: 'number',
- displayOptions: { hide: { responseMode: ['responseNode'] } },
- typeOptions: { minValue: 100, maxValue: 599 },
- default: 200,
- description: 'The HTTP Response code to return',
- },
- {
- displayName: 'Response Data',
- name: 'responseData',
- type: 'options',
- displayOptions: { show: { responseMode: ['lastNode'] } },
- options: [
- {
- name: 'All Entries',
- value: 'allEntries',
- description: 'Returns all the entries of the last node. Always returns an array.',
- },
- {
- name: 'First Entry JSON',
- value: 'firstEntryJson',
- description:
- 'Returns the JSON data of the first entry of the last node. Always returns a JSON object.',
- },
- {
- name: 'First Entry Binary',
- value: 'firstEntryBinary',
- description:
- 'Returns the binary data of the first entry of the last node. Always returns a binary file.',
- },
- { name: 'No Response Body', value: 'noData', description: 'Returns without a body' },
- ],
- default: 'firstEntryJson',
- description:
- 'What data should be returned. If it should return all items as an array or only the first item as object.',
- },
- {
- displayName: 'Property Name',
- name: 'responseBinaryPropertyName',
- type: 'string',
- required: true,
- default: 'data',
- displayOptions: { show: { responseData: ['firstEntryBinary'] } },
- description: 'Name of the binary property to return',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- options: [
- {
- displayName: 'Binary Data',
- name: 'binaryData',
- type: 'boolean',
- displayOptions: { show: { '/httpMethod': ['PATCH', 'PUT', 'POST'], '@version': [1] } },
- default: false,
- description: 'Whether the webhook will receive binary data',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- displayOptions: { show: { binaryData: [true], '@version': [1] } },
- description:
- 'Name of the binary property to write the data of the received file to. If the data gets received via "Form-Data Multipart" it will be the prefix and a number starting with 0 will be attached to it.',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- displayOptions: { hide: { '@version': [1] } },
- description:
- 'Name of the binary property to write the data of the received file to, only relevant if binary data is received',
- },
- {
- displayName: 'Ignore Bots',
- name: 'ignoreBots',
- type: 'boolean',
- default: false,
- description: 'Whether to ignore requests from bots like link previewers and web crawlers',
- },
- {
- displayName: 'No Response Body',
- name: 'noResponseBody',
- type: 'boolean',
- default: false,
- description: 'Whether to send any body in the response',
- displayOptions: {
- hide: { rawBody: [true] },
- show: { '/responseMode': ['onReceived'] },
- },
- },
- {
- displayName: 'Raw Body',
- name: 'rawBody',
- type: 'boolean',
- displayOptions: {
- show: { '@version': [1] },
- hide: { binaryData: [true], noResponseBody: [true] },
- },
- default: false,
- description: 'Raw body (binary)',
- },
- {
- displayName: 'Raw Body',
- name: 'rawBody',
- type: 'boolean',
- displayOptions: { hide: { noResponseBody: [true], '@version': [1] } },
- default: false,
- description: 'Whether to return the raw body',
- },
- {
- displayName: 'Response Data',
- name: 'responseData',
- type: 'string',
- displayOptions: {
- show: { '/responseMode': ['onReceived'] },
- hide: { noResponseBody: [true] },
- },
- default: '',
- placeholder: 'success',
- description: 'Custom response data to send',
- },
- {
- displayName: 'Response Content-Type',
- name: 'responseContentType',
- type: 'string',
- displayOptions: {
- show: { '/responseData': ['firstEntryJson'], '/responseMode': ['lastNode'] },
- },
- default: '',
- placeholder: 'application/xml',
- description:
- 'Set a custom content-type to return if another one as the "application/json" should be returned',
- },
- {
- displayName: 'Response Headers',
- name: 'responseHeaders',
- placeholder: 'Add Response Header',
- description: 'Add headers to the webhook response',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- name: 'entries',
- displayName: 'Entries',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: '',
- description: 'Name of the header',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value of the header',
- },
- ],
- },
- ],
- },
- {
- displayName: 'Property Name',
- name: 'responsePropertyName',
- type: 'string',
- displayOptions: {
- show: { '/responseData': ['firstEntryJson'], '/responseMode': ['lastNode'] },
- },
- default: 'data',
- description: 'Name of the property to return the data of instead of the whole JSON',
- },
- {
- displayName: 'Allowed Origins (CORS)',
- name: 'allowedOrigins',
- type: 'string',
- default: '*',
- description:
- 'The origin(s) to allow cross-origin non-preflight requests from in a browser',
- },
- ],
- },
- ],
- codex: {
- categories: ['Development', 'Core Nodes'],
- subcategories: { 'Core Nodes': ['Helpers'] },
- resources: {
- primaryDocumentation: [
- { url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/' },
- ],
- },
- alias: ['HTTP', 'API', 'Build', 'WH'],
- },
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/Webhook/webhook.svg',
-} satisfies INodeTypeDescription;
-
-export const nodeTypeWebhookV1_1 = {
- displayName: 'Webhook',
- name: 'n8n-nodes-base.webhook',
- group: ['trigger'],
- version: [1, 1.1],
- description: 'Starts the workflow when a webhook is called',
- eventTriggerDescription: 'Waiting for you to call the Test URL',
- activationMessage: 'You can now make calls to your production webhook URL.',
- defaults: { name: 'Webhook' },
- supportsCORS: true,
- triggerPanel: {
- header: '',
- executionsHelp: {
- inactive:
- 'Webhooks have two modes: test and production.
Use test mode while you build your workflow. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.
Use production mode to run your workflow automatically. Activate the workflow, then make requests to the production URL. These executions will show up in the executions list, but not in the editor.',
- active:
- 'Webhooks have two modes: test and production.
Use test mode while you build your workflow. Click the \'listen\' button, then make a request to the test URL. The executions will show up in the editor.
Use production mode to run your workflow automatically. Since the workflow is activated, you can make requests to the production URL. These executions will show up in the executions list, but not in the editor.',
- },
- activationHint:
- 'Once you’ve finished building your workflow, run it without having to click this button by using the production webhook URL.',
- },
- inputs: [],
- outputs: ['main'],
- credentials: [
- {
- name: 'httpBasicAuth',
- required: true,
- displayOptions: { show: { authentication: ['basicAuth'] } },
- },
- {
- name: 'httpHeaderAuth',
- required: true,
- displayOptions: { show: { authentication: ['headerAuth'] } },
- },
- ],
- webhooks: [
- {
- name: 'default',
- httpMethod: '={{$parameter["httpMethod"] || "GET"}}',
- isFullPath: true,
- responseCode: '={{$parameter["responseCode"]}}',
- responseMode: '={{$parameter["responseMode"]}}',
- responseData:
- '={{$parameter["responseData"] || ($parameter.options.noResponseBody ? "noData" : undefined) }}',
- responseBinaryPropertyName: '={{$parameter["responseBinaryPropertyName"]}}',
- responseContentType: '={{$parameter["options"]["responseContentType"]}}',
- responsePropertyName: '={{$parameter["options"]["responsePropertyName"]}}',
- responseHeaders: '={{$parameter["options"]["responseHeaders"]}}',
- path: '={{$parameter["path"]}}',
- },
- ],
- properties: [
- {
- displayName: 'Authentication',
- name: 'authentication',
- type: 'options',
- options: [
- { name: 'Basic Auth', value: 'basicAuth' },
- { name: 'Header Auth', value: 'headerAuth' },
- { name: 'None', value: 'none' },
- ],
- default: 'none',
- description: 'The way to authenticate',
- },
- {
- displayName: 'HTTP Method',
- name: 'httpMethod',
- type: 'options',
- options: [
- { name: 'DELETE', value: 'DELETE' },
- { name: 'GET', value: 'GET' },
- { name: 'HEAD', value: 'HEAD' },
- { name: 'PATCH', value: 'PATCH' },
- { name: 'POST', value: 'POST' },
- { name: 'PUT', value: 'PUT' },
- ],
- default: 'GET',
- description: 'The HTTP method to listen to',
- },
- {
- displayName: 'Path',
- name: 'path',
- type: 'string',
- default: '',
- placeholder: 'webhook',
- required: true,
- description: 'The path to listen to',
- },
- {
- displayName: 'Respond',
- name: 'responseMode',
- type: 'options',
- options: [
- {
- name: 'Immediately',
- value: 'onReceived',
- description: 'As soon as this node executes',
- },
- {
- name: 'When Last Node Finishes',
- value: 'lastNode',
- description: 'Returns data of the last-executed node',
- },
- {
- name: "Using 'Respond to Webhook' Node",
- value: 'responseNode',
- description: 'Response defined in that node',
- },
- ],
- default: 'onReceived',
- description: 'When and how to respond to the webhook',
- },
- {
- displayName:
- 'Insert a \'Respond to Webhook\' node to control when and how you respond. More details',
- name: 'webhookNotice',
- type: 'notice',
- displayOptions: { show: { responseMode: ['responseNode'] } },
- default: '',
- },
- {
- displayName: 'Response Code',
- name: 'responseCode',
- type: 'number',
- displayOptions: { hide: { responseMode: ['responseNode'] } },
- typeOptions: { minValue: 100, maxValue: 599 },
- default: 200,
- description: 'The HTTP Response code to return',
- },
- {
- displayName: 'Response Data',
- name: 'responseData',
- type: 'options',
- displayOptions: { show: { responseMode: ['lastNode'] } },
- options: [
- {
- name: 'All Entries',
- value: 'allEntries',
- description: 'Returns all the entries of the last node. Always returns an array.',
- },
- {
- name: 'First Entry JSON',
- value: 'firstEntryJson',
- description:
- 'Returns the JSON data of the first entry of the last node. Always returns a JSON object.',
- },
- {
- name: 'First Entry Binary',
- value: 'firstEntryBinary',
- description:
- 'Returns the binary data of the first entry of the last node. Always returns a binary file.',
- },
- { name: 'No Response Body', value: 'noData', description: 'Returns without a body' },
- ],
- default: 'firstEntryJson',
- description:
- 'What data should be returned. If it should return all items as an array or only the first item as object.',
- },
- {
- displayName: 'Property Name',
- name: 'responseBinaryPropertyName',
- type: 'string',
- required: true,
- default: 'data',
- displayOptions: { show: { responseData: ['firstEntryBinary'] } },
- description: 'Name of the binary property to return',
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- options: [
- {
- displayName: 'Binary Data',
- name: 'binaryData',
- type: 'boolean',
- displayOptions: { show: { '/httpMethod': ['PATCH', 'PUT', 'POST'], '@version': [1] } },
- default: false,
- description: 'Whether the webhook will receive binary data',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- displayOptions: { show: { binaryData: [true], '@version': [1] } },
- description:
- 'Name of the binary property to write the data of the received file to. If the data gets received via "Form-Data Multipart" it will be the prefix and a number starting with 0 will be attached to it.',
- },
- {
- displayName: 'Binary Property',
- name: 'binaryPropertyName',
- type: 'string',
- default: 'data',
- displayOptions: { hide: { '@version': [1] } },
- description:
- 'Name of the binary property to write the data of the received file to, only relevant if binary data is received',
- },
- {
- displayName: 'Ignore Bots',
- name: 'ignoreBots',
- type: 'boolean',
- default: false,
- description: 'Whether to ignore requests from bots like link previewers and web crawlers',
- },
- {
- displayName: 'No Response Body',
- name: 'noResponseBody',
- type: 'boolean',
- default: false,
- description: 'Whether to send any body in the response',
- displayOptions: {
- hide: { rawBody: [true] },
- show: { '/responseMode': ['onReceived'] },
- },
- },
- {
- displayName: 'Raw Body',
- name: 'rawBody',
- type: 'boolean',
- displayOptions: {
- show: { '@version': [1] },
- hide: { binaryData: [true], noResponseBody: [true] },
- },
- default: false,
- description: 'Raw body (binary)',
- },
- {
- displayName: 'Raw Body',
- name: 'rawBody',
- type: 'boolean',
- displayOptions: { hide: { noResponseBody: [true], '@version': [1] } },
- default: false,
- description: 'Whether to return the raw body',
- },
- {
- displayName: 'Response Data',
- name: 'responseData',
- type: 'string',
- displayOptions: {
- show: { '/responseMode': ['onReceived'] },
- hide: { noResponseBody: [true] },
- },
- default: '',
- placeholder: 'success',
- description: 'Custom response data to send',
- },
- {
- displayName: 'Response Content-Type',
- name: 'responseContentType',
- type: 'string',
- displayOptions: {
- show: { '/responseData': ['firstEntryJson'], '/responseMode': ['lastNode'] },
- },
- default: '',
- placeholder: 'application/xml',
- description:
- 'Set a custom content-type to return if another one as the "application/json" should be returned',
- },
- {
- displayName: 'Response Headers',
- name: 'responseHeaders',
- placeholder: 'Add Response Header',
- description: 'Add headers to the webhook response',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true },
- default: {},
- options: [
- {
- name: 'entries',
- displayName: 'Entries',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: '',
- description: 'Name of the header',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'Value of the header',
- },
- ],
- },
- ],
- },
- {
- displayName: 'Property Name',
- name: 'responsePropertyName',
- type: 'string',
- displayOptions: {
- show: { '/responseData': ['firstEntryJson'], '/responseMode': ['lastNode'] },
- },
- default: 'data',
- description: 'Name of the property to return the data of instead of the whole JSON',
- },
- {
- displayName: 'Allowed Origins (CORS)',
- name: 'allowedOrigins',
- type: 'string',
- default: '*',
- description:
- 'The origin(s) to allow cross-origin non-preflight requests from in a browser',
- },
- ],
},
],
- codex: {
- categories: ['Development', 'Core Nodes'],
- subcategories: { 'Core Nodes': ['Helpers'] },
- resources: {
- primaryDocumentation: [
- { url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/' },
- ],
- },
- alias: ['HTTP', 'API', 'Build', 'WH'],
- },
- iconUrl: 'icons/n8n-nodes-base/dist/nodes/Webhook/webhook.svg',
-} satisfies INodeTypeDescription;
-
-export const nodeTypesSet = {
- '1': {
- displayName: 'Set',
- name: 'n8n-nodes-base.set',
- icon: 'fa:pen',
- group: ['input'],
- description: 'Sets values on items and optionally remove other values',
- defaultVersion: 3.2,
- version: [1, 2],
- defaults: { name: 'Set', color: '#0000FF' },
- inputs: ['main'],
- outputs: ['main'],
- properties: [
- {
- displayName: 'Keep Only Set',
- name: 'keepOnlySet',
- type: 'boolean',
- default: false,
- description:
- 'Whether only the values set on this node should be kept and all others removed',
- },
- {
- displayName: 'Values to Set',
- name: 'values',
- placeholder: 'Add Value',
- type: 'fixedCollection',
- typeOptions: { multipleValues: true, sortable: true },
- description: 'The value to set',
- default: {},
- options: [
- {
- name: 'boolean',
- displayName: 'Boolean',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- requiresDataPath: 'single',
- default: 'propertyName',
- description:
- 'Name of the property to write data to. Supports dot-notation. Example: "data.person[0].name"',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'boolean',
- default: false,
- description: 'The boolean value to write in the property',
- },
- ],
- },
- {
- name: 'number',
- displayName: 'Number',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: 'propertyName',
- requiresDataPath: 'single',
- description:
- 'Name of the property to write data to. Supports dot-notation. Example: "data.person[0].name"',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'number',
- default: 0,
- description: 'The number value to write in the property',
- },
- ],
- },
- {
- name: 'string',
- displayName: 'String',
- values: [
- {
- displayName: 'Name',
- name: 'name',
- type: 'string',
- default: 'propertyName',
- requiresDataPath: 'single',
- description:
- 'Name of the property to write data to. Supports dot-notation. Example: "data.person[0].name"',
- },
- {
- displayName: 'Value',
- name: 'value',
- type: 'string',
- default: '',
- description: 'The string value to write in the property',
- },
- ],
- },
- ],
- },
- {
- displayName: 'Options',
- name: 'options',
- type: 'collection',
- placeholder: 'Add Option',
- default: {},
- options: [
- {
- displayName: 'Dot Notation',
- name: 'dotNotation',
- type: 'boolean',
- default: true,
- description:
- '
By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }.
If that is not intended this can be deactivated, it will then set { "a.b": value } instead..', - }, - ], - }, - ], - codex: { - categories: ['Core Nodes'], - subcategories: { 'Core Nodes': ['Data Transformation'] }, - resources: { - primaryDocumentation: [ - { url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/' }, - ], - }, - alias: ['Set', 'JSON', 'Filter', 'Transform', 'Map'], - }, - }, - '3': { - displayName: 'Edit Fields (Set)', - name: 'n8n-nodes-base.set', - icon: 'fa:pen', - group: ['input'], - description: 'Modify, add, or remove item fields', - defaultVersion: 3.2, - version: [3, 3.1, 3.2], - subtitle: '={{$parameter["mode"]}}', - defaults: { name: 'Edit Fields', color: '#0000FF' }, - inputs: ['main'], - outputs: ['main'], - properties: [ - { - displayName: 'Mode', - name: 'mode', - type: 'options', - noDataExpression: true, - options: [ - { - name: 'Manual Mapping', - value: 'manual', - description: 'Edit item fields one by one', - action: 'Edit item fields one by one', - }, - { - name: 'JSON Output', - value: 'raw', - description: 'Customize item output with JSON', - action: 'Customize item output with JSON', - }, - ], - default: 'manual', - }, - { - displayName: 'Duplicate Item', - name: 'duplicateItem', - type: 'boolean', - default: false, - isNodeSetting: true, - }, - { - displayName: 'Duplicate Item Count', - name: 'duplicateCount', - type: 'number', - default: 0, - typeOptions: { minValue: 0 }, - description: - 'How many times the item should be duplicated, mainly used for testing and debugging', - isNodeSetting: true, - displayOptions: { show: { duplicateItem: [true] } }, - }, - { - displayName: - 'Item duplication is set in the node settings. This option will be ignored when the workflow runs automatically.', - name: 'duplicateWarning', - type: 'notice', - default: '', - displayOptions: { show: { duplicateItem: [true] } }, - }, - { - displayName: 'JSON Output', - name: 'jsonOutput', - type: 'json', - typeOptions: { rows: 5 }, - default: '{\n "my_field_1": "value",\n "my_field_2": 1\n}', - validateType: 'object', - ignoreValidationDuringExecution: true, - displayOptions: { show: { mode: ['raw'] } }, - }, - { - displayName: 'Fields to Set', - name: 'fields', - placeholder: 'Add Field', - type: 'fixedCollection', - description: 'Edit existing fields or add new ones to modify the output data', - typeOptions: { multipleValues: true, sortable: true }, - default: {}, - options: [ - { - name: 'values', - displayName: 'Values', - values: [ - { - displayName: 'Name', - name: 'name', - type: 'string', - default: '', - placeholder: 'e.g. fieldName', - description: - 'Name of the field to set the value of. Supports dot-notation. Example: data.person[0].name.', - requiresDataPath: 'single', - }, - { - displayName: 'Type', - name: 'type', - type: 'options', - description: 'The field value type', - options: [ - { name: 'String', value: 'stringValue' }, - { name: 'Number', value: 'numberValue' }, - { name: 'Boolean', value: 'booleanValue' }, - { name: 'Array', value: 'arrayValue' }, - { name: 'Object', value: 'objectValue' }, - ], - default: 'stringValue', - }, - { - displayName: 'Value', - name: 'stringValue', - type: 'string', - default: '', - displayOptions: { show: { type: ['stringValue'] } }, - validateType: 'string', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'numberValue', - type: 'string', - default: '', - displayOptions: { show: { type: ['numberValue'] } }, - validateType: 'number', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'booleanValue', - type: 'options', - default: 'true', - options: [ - { name: 'True', value: 'true' }, - { name: 'False', value: 'false' }, - ], - displayOptions: { show: { type: ['booleanValue'] } }, - validateType: 'boolean', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'arrayValue', - type: 'string', - default: '', - placeholder: 'e.g. [ arrayItem1, arrayItem2, arrayItem3 ]', - displayOptions: { show: { type: ['arrayValue'] } }, - validateType: 'array', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'objectValue', - type: 'json', - default: '={}', - typeOptions: { rows: 2 }, - displayOptions: { show: { type: ['objectValue'] } }, - validateType: 'object', - ignoreValidationDuringExecution: true, - }, - ], - }, - ], - displayOptions: { show: { mode: ['manual'] } }, - }, - { - displayName: 'Include in Output', - name: 'include', - type: 'options', - description: 'How to select the fields you want to include in your output items', - default: 'all', - options: [ - { - name: 'All Input Fields', - value: 'all', - description: 'Also include all unchanged fields from the input', - }, - { - name: 'No Input Fields', - value: 'none', - description: 'Include only the fields specified above', - }, - { - name: 'Selected Input Fields', - value: 'selected', - description: 'Also include the fields listed in the parameter “Fields to Include”', - }, - { - name: 'All Input Fields Except', - value: 'except', - description: 'Exclude the fields listed in the parameter “Fields to Exclude”', - }, - ], - }, - { - displayName: 'Fields to Include', - name: 'includeFields', - type: 'string', - default: '', - placeholder: 'e.g. fieldToInclude1,fieldToInclude2', - description: - 'Comma-separated list of the field names you want to include in the output. You can drag the selected fields from the input panel.', - requiresDataPath: 'multiple', - displayOptions: { show: { include: ['selected'] } }, - }, - { - displayName: 'Fields to Exclude', - name: 'excludeFields', - type: 'string', - default: '', - placeholder: 'e.g. fieldToExclude1,fieldToExclude2', - description: - 'Comma-separated list of the field names you want to exclude from the output. You can drag the selected fields from the input panel.', - requiresDataPath: 'multiple', - displayOptions: { show: { include: ['except'] } }, - }, - { - displayName: 'Options', - name: 'options', - type: 'collection', - placeholder: 'Add Option', - default: {}, - options: [ - { - displayName: 'Include Binary Data', - name: 'includeBinary', - type: 'boolean', - default: true, - description: 'Whether binary data should be included if present in the input item', - }, - { - displayName: 'Ignore Type Conversion Errors', - name: 'ignoreConversionErrors', - type: 'boolean', - default: false, - description: - 'Whether to ignore field type errors and apply a less strict type conversion', - displayOptions: { show: { '/mode': ['manual'] } }, - }, - { - displayName: 'Support Dot Notation', - name: 'dotNotation', - type: 'boolean', - default: true, - description: - 'By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }. If that is not intended this can be deactivated, it will then set { "a.b": value } instead.', - }, - ], - }, - ], - codex: { - categories: ['Core Nodes'], - subcategories: { 'Core Nodes': ['Data Transformation'] }, - resources: { - primaryDocumentation: [ - { url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/' }, - ], - }, - alias: ['Set', 'JSON', 'Filter', 'Transform', 'Map'], - }, - }, - '3.1': { - displayName: 'Edit Fields (Set)', - name: 'n8n-nodes-base.set', - icon: 'fa:pen', - group: ['input'], - description: 'Modify, add, or remove item fields', - defaultVersion: 3.2, - version: [3, 3.1, 3.2], - subtitle: '={{$parameter["mode"]}}', - defaults: { name: 'Edit Fields', color: '#0000FF' }, - inputs: ['main'], - outputs: ['main'], - properties: [ - { - displayName: 'Mode', - name: 'mode', - type: 'options', - noDataExpression: true, - options: [ - { - name: 'Manual Mapping', - value: 'manual', - description: 'Edit item fields one by one', - action: 'Edit item fields one by one', - }, - { - name: 'JSON Output', - value: 'raw', - description: 'Customize item output with JSON', - action: 'Customize item output with JSON', - }, - ], - default: 'manual', - }, - { - displayName: 'Duplicate Item', - name: 'duplicateItem', - type: 'boolean', - default: false, - isNodeSetting: true, - }, - { - displayName: 'Duplicate Item Count', - name: 'duplicateCount', - type: 'number', - default: 0, - typeOptions: { minValue: 0 }, - description: - 'How many times the item should be duplicated, mainly used for testing and debugging', - isNodeSetting: true, - displayOptions: { show: { duplicateItem: [true] } }, - }, - { - displayName: - 'Item duplication is set in the node settings. This option will be ignored when the workflow runs automatically.', - name: 'duplicateWarning', - type: 'notice', - default: '', - displayOptions: { show: { duplicateItem: [true] } }, - }, - { - displayName: 'JSON Output', - name: 'jsonOutput', - type: 'json', - typeOptions: { rows: 5 }, - default: '{\n "my_field_1": "value",\n "my_field_2": 1\n}', - validateType: 'object', - ignoreValidationDuringExecution: true, - displayOptions: { show: { mode: ['raw'] } }, - }, - { - displayName: 'Fields to Set', - name: 'fields', - placeholder: 'Add Field', - type: 'fixedCollection', - description: 'Edit existing fields or add new ones to modify the output data', - typeOptions: { multipleValues: true, sortable: true }, - default: {}, - options: [ - { - name: 'values', - displayName: 'Values', - values: [ - { - displayName: 'Name', - name: 'name', - type: 'string', - default: '', - placeholder: 'e.g. fieldName', - description: - 'Name of the field to set the value of. Supports dot-notation. Example: data.person[0].name.', - requiresDataPath: 'single', - }, - { - displayName: 'Type', - name: 'type', - type: 'options', - description: 'The field value type', - options: [ - { name: 'String', value: 'stringValue' }, - { name: 'Number', value: 'numberValue' }, - { name: 'Boolean', value: 'booleanValue' }, - { name: 'Array', value: 'arrayValue' }, - { name: 'Object', value: 'objectValue' }, - ], - default: 'stringValue', - }, - { - displayName: 'Value', - name: 'stringValue', - type: 'string', - default: '', - displayOptions: { show: { type: ['stringValue'] } }, - validateType: 'string', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'numberValue', - type: 'string', - default: '', - displayOptions: { show: { type: ['numberValue'] } }, - validateType: 'number', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'booleanValue', - type: 'options', - default: 'true', - options: [ - { name: 'True', value: 'true' }, - { name: 'False', value: 'false' }, - ], - displayOptions: { show: { type: ['booleanValue'] } }, - validateType: 'boolean', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'arrayValue', - type: 'string', - default: '', - placeholder: 'e.g. [ arrayItem1, arrayItem2, arrayItem3 ]', - displayOptions: { show: { type: ['arrayValue'] } }, - validateType: 'array', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'objectValue', - type: 'json', - default: '={}', - typeOptions: { rows: 2 }, - displayOptions: { show: { type: ['objectValue'] } }, - validateType: 'object', - ignoreValidationDuringExecution: true, - }, - ], - }, - ], - displayOptions: { show: { mode: ['manual'] } }, - }, - { - displayName: 'Include in Output', - name: 'include', - type: 'options', - description: 'How to select the fields you want to include in your output items', - default: 'all', - options: [ - { - name: 'All Input Fields', - value: 'all', - description: 'Also include all unchanged fields from the input', - }, - { - name: 'No Input Fields', - value: 'none', - description: 'Include only the fields specified above', - }, - { - name: 'Selected Input Fields', - value: 'selected', - description: 'Also include the fields listed in the parameter “Fields to Include”', - }, - { - name: 'All Input Fields Except', - value: 'except', - description: 'Exclude the fields listed in the parameter “Fields to Exclude”', - }, - ], - }, - { - displayName: 'Fields to Include', - name: 'includeFields', - type: 'string', - default: '', - placeholder: 'e.g. fieldToInclude1,fieldToInclude2', - description: - 'Comma-separated list of the field names you want to include in the output. You can drag the selected fields from the input panel.', - requiresDataPath: 'multiple', - displayOptions: { show: { include: ['selected'] } }, - }, - { - displayName: 'Fields to Exclude', - name: 'excludeFields', - type: 'string', - default: '', - placeholder: 'e.g. fieldToExclude1,fieldToExclude2', - description: - 'Comma-separated list of the field names you want to exclude from the output. You can drag the selected fields from the input panel.', - requiresDataPath: 'multiple', - displayOptions: { show: { include: ['except'] } }, - }, - { - displayName: 'Options', - name: 'options', - type: 'collection', - placeholder: 'Add Option', - default: {}, - options: [ - { - displayName: 'Include Binary Data', - name: 'includeBinary', - type: 'boolean', - default: true, - description: 'Whether binary data should be included if present in the input item', - }, - { - displayName: 'Ignore Type Conversion Errors', - name: 'ignoreConversionErrors', - type: 'boolean', - default: false, - description: - 'Whether to ignore field type errors and apply a less strict type conversion', - displayOptions: { show: { '/mode': ['manual'] } }, - }, - { - displayName: 'Support Dot Notation', - name: 'dotNotation', - type: 'boolean', - default: true, - description: - 'By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }. If that is not intended this can be deactivated, it will then set { "a.b": value } instead.', - }, - ], - }, - ], - codex: { - categories: ['Core Nodes'], - subcategories: { 'Core Nodes': ['Data Transformation'] }, - resources: { - primaryDocumentation: [ - { url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/' }, - ], - }, - alias: ['Set', 'JSON', 'Filter', 'Transform', 'Map'], - }, - }, - '3.2': { - displayName: 'Edit Fields (Set)', - name: 'n8n-nodes-base.set', - icon: 'fa:pen', - group: ['input'], - description: 'Modify, add, or remove item fields', - defaultVersion: 3.2, - version: [3, 3.1, 3.2], - subtitle: '={{$parameter["mode"]}}', - defaults: { name: 'Edit Fields', color: '#0000FF' }, - inputs: ['main'], - outputs: ['main'], - properties: [ - { - displayName: 'Mode', - name: 'mode', - type: 'options', - noDataExpression: true, - options: [ - { - name: 'Manual Mapping', - value: 'manual', - description: 'Edit item fields one by one', - action: 'Edit item fields one by one', - }, - { - name: 'JSON Output', - value: 'raw', - description: 'Customize item output with JSON', - action: 'Customize item output with JSON', - }, - ], - default: 'manual', - }, - { - displayName: 'Duplicate Item', - name: 'duplicateItem', - type: 'boolean', - default: false, - isNodeSetting: true, - }, - { - displayName: 'Duplicate Item Count', - name: 'duplicateCount', - type: 'number', - default: 0, - typeOptions: { minValue: 0 }, - description: - 'How many times the item should be duplicated, mainly used for testing and debugging', - isNodeSetting: true, - displayOptions: { show: { duplicateItem: [true] } }, - }, - { - displayName: - 'Item duplication is set in the node settings. This option will be ignored when the workflow runs automatically.', - name: 'duplicateWarning', - type: 'notice', - default: '', - displayOptions: { show: { duplicateItem: [true] } }, - }, - { - displayName: 'JSON Output', - name: 'jsonOutput', - type: 'json', - typeOptions: { rows: 5 }, - default: '{\n "my_field_1": "value",\n "my_field_2": 1\n}', - validateType: 'object', - ignoreValidationDuringExecution: true, - displayOptions: { show: { mode: ['raw'] } }, - }, - { - displayName: 'Fields to Set', - name: 'fields', - placeholder: 'Add Field', - type: 'fixedCollection', - description: 'Edit existing fields or add new ones to modify the output data', - typeOptions: { multipleValues: true, sortable: true }, - default: {}, - options: [ - { - name: 'values', - displayName: 'Values', - values: [ - { - displayName: 'Name', - name: 'name', - type: 'string', - default: '', - placeholder: 'e.g. fieldName', - description: - 'Name of the field to set the value of. Supports dot-notation. Example: data.person[0].name.', - requiresDataPath: 'single', - }, - { - displayName: 'Type', - name: 'type', - type: 'options', - description: 'The field value type', - options: [ - { name: 'String', value: 'stringValue' }, - { name: 'Number', value: 'numberValue' }, - { name: 'Boolean', value: 'booleanValue' }, - { name: 'Array', value: 'arrayValue' }, - { name: 'Object', value: 'objectValue' }, - ], - default: 'stringValue', - }, - { - displayName: 'Value', - name: 'stringValue', - type: 'string', - default: '', - displayOptions: { show: { type: ['stringValue'] } }, - validateType: 'string', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'numberValue', - type: 'string', - default: '', - displayOptions: { show: { type: ['numberValue'] } }, - validateType: 'number', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'booleanValue', - type: 'options', - default: 'true', - options: [ - { name: 'True', value: 'true' }, - { name: 'False', value: 'false' }, - ], - displayOptions: { show: { type: ['booleanValue'] } }, - validateType: 'boolean', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'arrayValue', - type: 'string', - default: '', - placeholder: 'e.g. [ arrayItem1, arrayItem2, arrayItem3 ]', - displayOptions: { show: { type: ['arrayValue'] } }, - validateType: 'array', - ignoreValidationDuringExecution: true, - }, - { - displayName: 'Value', - name: 'objectValue', - type: 'json', - default: '={}', - typeOptions: { rows: 2 }, - displayOptions: { show: { type: ['objectValue'] } }, - validateType: 'object', - ignoreValidationDuringExecution: true, - }, - ], - }, - ], - displayOptions: { show: { mode: ['manual'] } }, - }, - { - displayName: 'Include in Output', - name: 'include', - type: 'options', - description: 'How to select the fields you want to include in your output items', - default: 'all', - options: [ - { - name: 'All Input Fields', - value: 'all', - description: 'Also include all unchanged fields from the input', - }, - { - name: 'No Input Fields', - value: 'none', - description: 'Include only the fields specified above', - }, - { - name: 'Selected Input Fields', - value: 'selected', - description: 'Also include the fields listed in the parameter “Fields to Include”', - }, - { - name: 'All Input Fields Except', - value: 'except', - description: 'Exclude the fields listed in the parameter “Fields to Exclude”', - }, - ], - }, - { - displayName: 'Fields to Include', - name: 'includeFields', - type: 'string', - default: '', - placeholder: 'e.g. fieldToInclude1,fieldToInclude2', - description: - 'Comma-separated list of the field names you want to include in the output. You can drag the selected fields from the input panel.', - requiresDataPath: 'multiple', - displayOptions: { show: { include: ['selected'] } }, - }, - { - displayName: 'Fields to Exclude', - name: 'excludeFields', - type: 'string', - default: '', - placeholder: 'e.g. fieldToExclude1,fieldToExclude2', - description: - 'Comma-separated list of the field names you want to exclude from the output. You can drag the selected fields from the input panel.', - requiresDataPath: 'multiple', - displayOptions: { show: { include: ['except'] } }, - }, - { - displayName: 'Options', - name: 'options', - type: 'collection', - placeholder: 'Add Option', - default: {}, - options: [ - { - displayName: 'Include Binary Data', - name: 'includeBinary', - type: 'boolean', - default: true, - description: 'Whether binary data should be included if present in the input item', - }, - { - displayName: 'Ignore Type Conversion Errors', - name: 'ignoreConversionErrors', - type: 'boolean', - default: false, - description: - 'Whether to ignore field type errors and apply a less strict type conversion', - displayOptions: { show: { '/mode': ['manual'] } }, - }, - { - displayName: 'Support Dot Notation', - name: 'dotNotation', - type: 'boolean', - default: true, - description: - 'By default, dot-notation is used in property names. This means that "a.b" will set the property "b" underneath "a" so { "a": { "b": value} }. If that is not intended this can be deactivated, it will then set { "a.b": value } instead.', - }, - ], - }, - ], - codex: { - categories: ['Core Nodes'], - subcategories: { 'Core Nodes': ['Data Transformation'] }, - resources: { - primaryDocumentation: [ - { url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/' }, - ], - }, - alias: ['Set', 'JSON', 'Filter', 'Transform', 'Map'], - }, - }, -} satisfies { [version: string]: INodeTypeDescription }; +}); diff --git a/packages/editor-ui/src/utils/testData/templateTestData.ts b/packages/editor-ui/src/utils/testData/templateTestData.ts deleted file mode 100644 index 255104459e5c7d..00000000000000 --- a/packages/editor-ui/src/utils/testData/templateTestData.ts +++ /dev/null @@ -1,450 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { faker } from '@faker-js/faker/locale/en'; -import type { ITemplatesWorkflowFull, IWorkflowTemplateNode } from '@/Interface'; -import { NodeConnectionType } from 'n8n-workflow'; - -export const newWorkflowTemplateNode = ({ - type, - ...optionalOpts -}: Pick