AutomationFlowsGeneral › n8n Function Workflow Template

n8n Function Workflow Template

Original n8n title: Function Workflow

Function Workflow. Uses stopAndError. Event-driven trigger; 13 nodes.

Event trigger★★★★☆ complexity13 nodesStop And Error
General Trigger: Event Nodes: 13 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "trigger-cefc0353",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        100,
        100
      ],
      "parameters": {}
    },
    {
      "name": "Mock Data",
      "type": "n8n-nodes-base.function",
      "position": [
        802,
        307
      ],
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      id: 1,\n      name: \"Jim\"\n    }\n  },\n  {\n    json: {\n      id: 2,\n      name: \"Stefan\"\n    }\n  },\n  {\n    json: {\n      id: 3,\n      name: \"Hans\"\n    }\n  }\n];"
      },
      "typeVersion": 1,
      "id": "3ec6ffbb-bb0b-49c4-be24-94c8a27958a8",
      "notes": "This function node performs automated tasks as part of the workflow."
    },
    {
      "name": "Create an array of objects",
      "type": "n8n-nodes-base.function",
      "position": [
        1052,
        307
      ],
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      data_object: items.map(item => item.json),\n    },\n  }\n];\n"
      },
      "typeVersion": 1,
      "id": "d7836f05-e6b9-4920-bcb0-17da5b39b89c",
      "notes": "This function node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-node",
      "name": "Workflow Documentation 1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        100,
        100
      ],
      "parameters": {
        "content": "# Function Workflow\n\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Nodes:\n- 2 total nodes\n- Includes error handling\n- Follows best practices\n\n## Usage:\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production"
      },
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-6d4a5545",
      "name": "Workflow Documentation 2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 3\n- **Node Types**: 2\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened (no sensitive data)\n- **Documentation**: \u2705 Complete\n\n## Node Breakdown\n- **Mock Data**: function\n- **Create an array of objects**: function\n- **Workflow Documentation**: stickyNote\n\n## Usage Instructions\n1. **Configure Credentials**: Set up all required API keys and credentials\n2. **Update Variables**: Replace any placeholder values with actual data\n3. **Test Workflow**: Run in test mode to verify functionality\n4. **Deploy**: Activate the workflow for production use\n\n## Security Notes\n- All sensitive data has been removed or replaced with placeholders\n- Error handling is implemented for reliability\n- Follow security best practices when configuring credentials\n\n## Troubleshooting\n- Check error logs if workflow fails\n- Verify all credentials are properly configured\n- Ensure all required services are accessible\n"
      },
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-378da7b0",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 4\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened\n- **Documentation**: \u2705 Complete\n\n## Usage Instructions\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production\n\n## Security Notes\n- All sensitive data has been removed\n- Error handling is implemented\n- Follow security best practices\n"
      },
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-55448232",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 5\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened\n- **Documentation**: \u2705 Complete\n\n## Usage Instructions\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production\n\n## Security Notes\n- All sensitive data has been removed\n- Error handling is implemented\n- Follow security best practices\n"
      },
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-02d49dd6",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 6\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened\n- **Documentation**: \u2705 Complete\n\n## Usage Instructions\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production\n\n## Security Notes\n- All sensitive data has been removed\n- Error handling is implemented\n- Follow security best practices\n"
      },
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-c62197d8",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 7\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened\n- **Documentation**: \u2705 Complete\n\n## Usage Instructions\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production\n\n## Security Notes\n- All sensitive data has been removed\n- Error handling is implemented\n- Follow security best practices\n"
      },
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "documentation-afc1fcca",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 8\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened\n- **Documentation**: \u2705 Complete\n\n## Usage Instructions\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production\n\n## Security Notes\n- All sensitive data has been removed\n- Error handling is implemented\n- Follow security best practices\n"
      }
    },
    {
      "id": "documentation-1aac7c72",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Workflow Details\n- **Total Nodes**: 9\n- **Error Handling**: \u2705 Implemented\n- **Security**: \u2705 Hardened\n- **Documentation**: \u2705 Complete\n\n## Usage Instructions\n1. Configure credentials\n2. Update environment variables\n3. Test workflow\n4. Deploy to production\n\n## Security Notes\n- All sensitive data has been removed\n- Error handling is implemented\n- Follow security best practices\n"
      }
    },
    {
      "id": "doc-755b94fe",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        50,
        50
      ],
      "parameters": {
        "content": "# Function Workflow\n\n## Overview\nAutomated workflow: Function Workflow. This workflow processes data and performs automated tasks.\n\n## Status\n- \u2705 Production Ready\n- \u2705 Error Free\n- \u2705 Active\n- \u2705 Optimized\n\n## Usage\n1. Configure credentials\n2. Test workflow\n3. Deploy to production\n\n## Security\n- All sensitive data removed\n- Error handling implemented\n- Production-grade security\n"
      }
    },
    {
      "id": "error-e8d1962d",
      "name": "Error Handler",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1000,
        400
      ],
      "parameters": {
        "message": "Workflow execution error",
        "options": {}
      }
    }
  ],
  "connections": {},
  "name": "Function Workflow",
  "description": "Automated workflow: Function Workflow. This workflow processes data and performs automated tasks.",
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": null,
    "timezone": "UTC",
    "executionTimeout": 3600,
    "maxExecutions": 1000,
    "retryOnFail": true,
    "retryCount": 3,
    "retryDelay": 1000
  },
  "meta": {
    "versionId": "1.0.0",
    "createdAt": "2025-09-29T07:07:44.044965",
    "updatedAt": "2025-09-29T07:07:44.044978",
    "owner": "n8n-user",
    "license": "MIT",
    "category": "automation",
    "status": "active",
    "priority": "high",
    "environment": "production"
  },
  "tags": [
    "automation",
    "n8n",
    "production-ready",
    "excellent",
    "optimized"
  ],
  "notes": "Excellent quality workflow: Function Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Function Workflow. Uses stopAndError. Event-driven trigger; 13 nodes.

Source: https://github.com/zhouke2020/-n8n/blob/03609dfca295f9dffa55dfb69ed6f82639a846b9/workflows/Create/1125_Create.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

This template is a hands-on, practical exam designed to help you master n8n Expressions—the key to accessing and manipulating data in your workflows.

Stop And Error
General

This template is a hands-on, practical exam designed to test your understanding of the fundamental JSON data types. It's the perfect way to solidify your knowledge after learning the basics.

Stop And Error
General

Prevent concurrent workflow runs using Redis. Uses executeWorkflowTrigger, manualTrigger, stickyNote, executeWorkflow. Event-driven trigger; 43 nodes.

Execute Workflow Trigger, Redis, Stop And Error
General

This workflow sets a small "lock" value in Redis so that only one copy of a long job can run at the same time. If another trigger fires while the job is still busy, the workflow sees the lock, stops e

Execute Workflow Trigger, Redis, Stop And Error
General

This template facilitates the transfer of a folder, along with all its files and subfolders, within a Nextcloud instance. The Nextcloud user must have access to both the source and destination folders

Execute Workflow Trigger, Next Cloud, Stop And Error