AutomationFlowsGeneral › Add Typescript Intellisense Support to Code Nodes with Jsdoc

Add Typescript Intellisense Support to Code Nodes with Jsdoc

ByWyeth @wyeth on n8n.io

Are you writing complex Code nodes and need Intellisense support? Follow this simple pattern to get autocomplete for any n8n or custom classes.

Event trigger★★★★☆ complexity8 nodesn8nForm TriggerForm
General Trigger: Event Nodes: 8 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #5602 — we link there as the canonical source.

This workflow follows the Form → Form Trigger recipe pattern — see all workflows that pair these two integrations.

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
{
  "id": "CHfMFle2Ym5WrORl",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Templates_Code_Intellisense",
  "tags": [],
  "nodes": [
    {
      "id": "4bb15488-9fbd-4233-a5fd-4ea336a28a04",
      "name": "Get This Workflow",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -300,
        -20
      ],
      "parameters": {
        "operation": "get",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e494c46-e9fc-40db-8a79-1329c46f30dc",
      "name": "Code With Intellisense",
      "type": "n8n-nodes-base.code",
      "position": [
        -20,
        -20
      ],
      "parameters": {
        "jsCode": "// ----------------------------------------------------------------\n\n// Define core classes you want intellisense for.\n\n/**\n * @typedef {Object} Node\n * @property {string} type\n * @property {number} typeVersion\n * @property {number} id\n * @property {string} name\n */\n\n/**\n * @typedef {Object} Workflow\n * @property {string} name\n * @property {number} id\n * @property {boolean} isArchived\n * @property {Array<Node>} nodes\n */\n\n// Use this inline casting to tell Intellisense what the variable is:\nconst wf = /** @type {Workflow} */ ($input.first().json);\n\nlet output = \"<p>Example:</p>\"; \n\n// Now check and see, wf will present Intellisense!\noutput += \"<p>Workflow.id: \" + wf.id + \"</p>\";\noutput += \"<p>Workflow.name: \" + wf.name + \"</p>\";\noutput += \"<p>Workflow.isArchived: \" + wf.isArchived + \"</p>\";\n\nfor (let i = 0; i < wf.nodes.length; i++) {\n  const node = wf.nodes[i];\n  // node will automatically know its type, Intellisense here\n  output += \"<p>Workflow.nodes[\" + i + \"]: \" + node.name + \"</p>\";\n  output += \"<p>Workflow.nodes[\" + i + \"]: \" + node.type + \"</p>\";\n}\n\nreturn [{ json: { result: output } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "6aeaf1f3-0eca-4f27-8a8e-62cae8e860c7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 320,
        "content": "## Setup\nJust get this workflow so we can show the Code node working."
      },
      "typeVersion": 1
    },
    {
      "id": "7fe8b7e9-0571-433f-b04a-4f2af8b69aa9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 320,
        "content": "## Example\nOpen the Code node and see how we've given Intellisense hints to Workflow and Node."
      },
      "typeVersion": 1
    },
    {
      "id": "74a61d70-17eb-44a5-a23c-c7f3035295e5",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -520,
        -20
      ],
      "parameters": {
        "options": {},
        "formTitle": "Test Code Node"
      },
      "typeVersion": 2.2
    },
    {
      "id": "758fcb50-9794-45c9-a9b1-c490fdd96fd8",
      "name": "Display Results",
      "type": "n8n-nodes-base.form",
      "position": [
        480,
        -20
      ],
      "parameters": {
        "options": {},
        "formFields": {
          "values": [
            {
              "html": "{{ $json.result }}\n\n",
              "fieldType": "html",
              "elementName": "output"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c938cf31-ea77-496a-8e73-a960ca41a586",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 320,
        "content": "## Output\nPrint results -- illustrative use of HTML in Forms."
      },
      "typeVersion": 1
    },
    {
      "id": "490fa90f-ca28-4046-a5b4-59db517c0c2d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -280
      ],
      "parameters": {
        "color": 7,
        "width": 1480,
        "height": 120,
        "content": "## Code node with Intellisense!\nThis example shows how to get Intellisense for n8n classes. Great when debugging complex Code nodes."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5c08e162-982f-4332-83a1-bca1c87af241",
  "connections": {
    "Display Results": {
      "main": [
        []
      ]
    },
    "Get This Workflow": {
      "main": [
        [
          {
            "node": "Code With Intellisense",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Get This Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code With Intellisense": {
      "main": [
        [
          {
            "node": "Display Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Are you writing complex Code nodes and need Intellisense support? Follow this simple pattern to get autocomplete for any n8n or custom classes.

Source: https://n8n.io/workflows/5602/ — 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 workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Form Trigger, n8n, Form +2
General

This workflow uses AI to automatically generate clear and descriptive names for every node in your n8n workflows. It analyzes each node's type, parameters, and connections to create meaningful names,

n8n, Chain Llm, Output Parser Structured +4
General

This interactive tutorial teaches you how to build in n8n from scratch, using a live walkthrough with real-time examples. Rather than static documentation, this guided workflow explains key n8n concep

Form Trigger, Form
General

Credentials Transfer. Uses form, httpRequest, executeCommand, readWriteFile. Event-driven trigger; 22 nodes.

Form, HTTP Request, Execute Command +2
General

Waitlist Form Stored In Googlesheet With Email Verification Step. Uses googleSheets, emailSend, form, stickyNote. Event-driven trigger; 19 nodes.

Google Sheets, Email Send, Form +2