Template_Code_IntelliSense

Intermedio

Este es unEngineeringflujo de automatización del dominio deautomatización que contiene 8 nodos.Utiliza principalmente nodos como N8n, Code, Form, FormTrigger. Adición de soporte de inteligencia de TypeScript a nodos de código usando JSDoc

Requisitos previos
  • No hay requisitos previos especiales, puede importar y usarlo directamente

Categoría

Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "CHfMFle2Ym5WrORl",
  "meta": {
    "instanceId": "87021cc08fe86f3c88c615ac7015b93e398b6bf953b85302471896e86cc798ef",
    "templateCredsSetupCompleted": true
  },
  "name": "Templates_Code_Intellisense",
  "tags": [],
  "nodes": [
    {
      "id": "4bb15488-9fbd-4233-a5fd-4ea336a28a04",
      "name": "Obtener Este Flujo",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -300,
        -20
      ],
      "parameters": {
        "operation": "get",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "id": "AtnwjrQQjpB80Z2Q",
          "name": "n8n unio API v1"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e494c46-e9fc-40db-8a79-1329c46f30dc",
      "name": "Código Con 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": "Nota Adhesiva",
      "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": "Nota Adhesiva1",
      "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": "Al enviar formulario",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -520,
        -20
      ],
      "webhookId": "d963f33b-cba8-4887-b9d1-65fe4bbc49ad",
      "parameters": {
        "options": {},
        "formTitle": "Test Code Node"
      },
      "typeVersion": 2.2
    },
    {
      "id": "758fcb50-9794-45c9-a9b1-c490fdd96fd8",
      "name": "Mostrar Resultados",
      "type": "n8n-nodes-base.form",
      "position": [
        480,
        -20
      ],
      "webhookId": "a45895a4-717c-4542-8663-8d6352ba8d19",
      "parameters": {
        "options": {},
        "formFields": {
          "values": [
            {
              "html": "{{ $json.result }}\n\n",
              "fieldType": "html",
              "elementName": "output"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c938cf31-ea77-496a-8e73-a960ca41a586",
      "name": "Nota Adhesiva2",
      "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": "Nota Adhesiva3",
      "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,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5c08e162-982f-4332-83a1-bca1c87af241",
  "connections": {
    "758fcb50-9794-45c9-a9b1-c490fdd96fd8": {
      "main": [
        []
      ]
    },
    "4bb15488-9fbd-4233-a5fd-4ea336a28a04": {
      "main": [
        [
          {
            "node": "9e494c46-e9fc-40db-8a79-1329c46f30dc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "74a61d70-17eb-44a5-a23c-c7f3035295e5": {
      "main": [
        [
          {
            "node": "4bb15488-9fbd-4233-a5fd-4ea336a28a04",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9e494c46-e9fc-40db-8a79-1329c46f30dc": {
      "main": [
        [
          {
            "node": "758fcb50-9794-45c9-a9b1-c490fdd96fd8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Ingeniería

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos8
Categoría1
Tipos de nodos5
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34