examples
Retrieve workflow examples for specific n8n node types to understand implementation patterns and accelerate development.
Instructions
Get examples for a specific n8n node type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The node type name (e.g., n8n-nodes-base.webhook) |
Implementation Reference
- src/index.ts:124-137 (registration)Tool registration including name, description, and input schema requiring 'type' parameter.{ name: 'examples', description: 'Get examples for a specific n8n node type', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'The node type name (e.g., n8n-nodes-base.webhook)', }, }, required: ['type'], }, },
- src/index.ts:680-701 (handler)Main handler for 'examples' tool: fetches examples from n8nClient, returns JSON success response or NOT_FOUND error.private async handleGetExamples(args: { type: string }) { const examples = await this.n8nClient.getNodeTypeExamples(args.type); if (examples.length === 0) { return { content: [ { type: 'text', text: JSON.stringify(jsonError(`No examples available for node type '${args.type}'.`, 'NOT_FOUND'), null, 2), }, ], }; } return { content: [ { type: 'text', text: JSON.stringify(jsonSuccess(examples), null, 2), }, ], }; }
- src/index.ts:256-257 (handler)Dispatch case in main CallToolRequestSchema handler that routes to handleGetExamples.case 'examples': return await this.handleGetExamples(request.params.arguments as { type: string });
- src/n8n-client.ts:296-298 (helper)N8nClient method delegating to node-registry getNodeExamples.async getNodeTypeExamples(typeName: string): Promise<N8nNodeExample[]> { return getNodeExamples(typeName); }
- src/node-registry.ts:400-402 (helper)Core function returning examples from NODE_EXAMPLES record for the given type.export function getNodeExamples(typeName: string): N8nNodeExample[] { return NODE_EXAMPLES[typeName] || []; }