AutomationFlowsGeneral › AI Workflow Chain with OpenRouter

AI Workflow Chain with OpenRouter

Original n8n title: Ehuvg2i1voyj0u6k My Workflow

Ehuvg2I1Voyj0U6K My Workflow. Uses executeWorkflowTrigger, chainLlm, outputParserStructured, lmChatOpenRouter. Event-driven trigger; 12 nodes.

Event trigger★★★★☆ complexityAI-powered12 nodesExecute Workflow TriggerChain LlmOutput Parser StructuredOpenRouter Chat
General Trigger: Event Nodes: 12 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Chainllm → Execute Workflow 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": "eHuvG2I1vOYj0U6k",
  "name": "My workflow",
  "tags": [
    {
      "id": "isKwzRd30jBHOwft",
      "name": "AI",
      "createdAt": "2025-03-20T12:19:54.225Z",
      "updatedAt": "2025-03-20T12:19:54.225Z"
    },
    {
      "id": "14BO5kV7hwR3aVmH",
      "name": "OAuth",
      "createdAt": "2025-03-20T12:19:58.622Z",
      "updatedAt": "2025-03-20T12:19:58.622Z"
    },
    {
      "id": "hzAAB0A7DmXlEfor",
      "name": "Service",
      "createdAt": "2025-03-20T12:20:03.063Z",
      "updatedAt": "2025-03-20T12:20:03.063Z"
    }
  ],
  "nodes": [
    {
      "id": "6503d6be-e4f3-4a06-b027-9fb210788a30",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        80,
        340
      ],
      "parameters": {
        "inputSource": "jsonExample",
        "jsonExample": "{\n  \"name\" : \"Atlassian\",\n  \"audience\" : \"api.atlassian.com\"\n}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "d6246380-096b-458f-a52c-b263c1e4b800",
      "name": "LLM Bus",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        400,
        340
      ],
      "parameters": {
        "text": "You are an AI agent tasked with identifying the (pretty-print) OAuth service name, audience, authorization URI, and token URI.\nThe input is only a name bearing on the OAUth service, e.g.:\n1. Jira.  The name Jira must be resolved to the correlated API service, in this case, Atlassian.  OAuth information can be gleaned from https://developer.atlassian.com/.\n2. Sage. This is potentially a vague name.  However, in the context of API and OAuth, it is probably Sage300 the ERP system.  OAuth information can be gleaned from https://developer.sage.com.\n3. SAP. This can be the SAP HANA Cloud Platform. Authorization is usually be dedicated URL, e.g., https://<host_name>:<port_number>/sap/bc/sec/oauth2/client/grant/authorization?\n4. Google. This can be the Google API, e.g., https://accounts.google.com/o/oauth2/v2/auth? with audience as project-id-random-value.apps.googleusercontent.com.\n\nObtaining these details by just knowing the pretty-name of the service might be cumbersome.  Therefore a confidence score, as a probabilistic indication your confidence\nof the data must be calculated.  Express your confidence score on a scale of 1 (absolute certainty) down to almost zero (least certain), i.e., confidence NUMERIC(3, 2) CHECK (confidence >= 0.1 AND confidence <= 1.0).\nIf you can't obtain information, invent the data, but justify your improvisation by assigning a very low confidence score.  You must always return a result, no matter\nhow low your confidence.\n\nThese Instructions comprise a Context Understanding, Information Retrieval, Output Format, an Example, with Accuracy and Verification.  \n1. Context Understanding: The name (as input) value represents the target API or service. You need to identify the service name, audience, authorization URI, and token URI based on the name value. \n2. Information Retrieval: Use reputable sources and official documentation to find the correct service name, audience, authorization URI and token URI.\n3. Output Format: Service Name: [Service Name], [Audience], [Authorization URI], [Token URI], [Details]: (Your choice rationale in about 100 words to justify your answer), and lastly the [Confidence] (probability factor) as a numeric value 0<x\u22641andx\u2208{0.01,0.02,\u2026,1.00}.\n4. Example 1: If the name is Sage, the service is probably something like sage300.yourdomain.com (where the yourdomain is clearly a proprietary name), the authorization and token uri follow the same pattern, e.g., \na. Service Name: Sage 300,\nb. Audience: sage300.yourdomain.com\nc. Authorization URI: https://sage300.yourdomain.com/oauth/authorize?, \nd. Token URI: https://sage300.yourdomain.com/oauth/token, \ne. Details: Your domain is embedded in the standard presentation of the audience, authorization uri, and the token uri.  Therefore I substituted the standard representations of the OAuth pattern. \nf. Confidence: 0.90 (=> 0<x\u22641andx\u2208{0.01,0.02,\u2026,1.00})\n5. Example 2: If the name is Jira, the API service is probably Atlassian the elements: \na. Service Name: Atlassian, \nb. Audience: api.atlassian.com\nc. Authorization URI: https://auth.atlassian.com/authorize?, \nd. Token URI: https://auth.atlassian.com/oauth/token, \ne. Details: I have referenced the Atlassian online API documentation and retrieved the standard presentation of the audience, authorization uri, and the token uri from their documentation. \nf. Confidence: 1 (=> 0<x\u22641andx\u2208{0.01,0.02,\u2026,1.00})\n6. Accuracy and Verification: Double-check the information to ensure it is correct and up-to-date. If the name value is ambiguous or not well-documented, provide the best possible match based on available information, or improvise an answer based on the patterns of OAuth, but assign a low Confidence.\n7. Improvisation when OAuth elements relating to the provided {{ $json.name }} (API service name) cannot be determined with high confidence you should specify common patterns or fallback options for OAuth and perform additional searches to cross-reference multiple sources to improve accuracy.\n",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=The OAuth requester wants you to define the:  OAuth Service (pretty print) Name, the audience (parameter in the authorization uri), the aurhorization_uri (for the API OAuth authorization call), the token_uri (for the token call), your explanation for choosing these values, and your Confidence about the information you provided. \nOutput the service_name, audience, authorization_uri, token_uri, details, and the Confidence factor.\nOAuth Service for which to obtain configuration: {{ $json.name }}.  \nProvide the requester with the pretty-print OAuth Service Name, the audience (authorization parameter) the authorization_uri, the token_uri, your rationale (in n more than 75 words) for choosing the values, and the Confidence factor pertaining."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "90cdcbfa-cf7e-4123-b241-dafaea12d1a4",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        640,
        580
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"Generated schema for Root\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"action\": {\n      \"type\": \"string\"\n    },\n    \"text\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"action\",\n    \"text\"\n  ]\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "5f8cb1e1-39e7-4617-9b56-e0b41bfee466",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        340,
        580
      ],
      "parameters": {
        "model": "latitudegames/wayfarer-large-70b-llama-3.3",
        "options": {
          "topP": 0.9,
          "maxTokens": 2500,
          "maxRetries": 2,
          "temperature": 0.5,
          "responseFormat": "json_object",
          "presencePenalty": 0.6,
          "frequencyPenalty": 0.5
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "13012149-1408-4dbc-9108-146281001562",
      "name": "Conform JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        340
      ],
      "parameters": {
        "jsCode": "// Extract the relevant information from the original output\nconst items =$input.all();\n// Extract the relevant information from the input\nconst originalText = items[0].json.output.text;\n\n// Parse the text to extract the required fields\nconst lines = originalText.split('\\n');\nconst service_name = lines[0].split(': ')[1];\nconst audience = lines[1].split(': ')[1];\nconst authorization_uri = lines[2].split(': ')[1];\nconst token_uri = lines[3].split(': ')[1];\nconst details = lines[4].split(': ')[1];\nconst confidence = parseFloat(lines[5].split(': ')[1]);\n\n// Return the transformed output\nreturn [\n  {\n    json: {\n      output: {\n        service_name,\n        audience,\n        authorization_uri,\n        token_uri,\n        details,\n        confidence\n      }\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "8d4d10a4-ac75-4fc7-a607-19d91cde6ac6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -200
      ],
      "parameters": {
        "color": 4,
        "width": 1100,
        "height": 360,
        "content": "## OAuth2 \uc124\uc815 \ucc3e\uae30 OpenRouter \ucc44\ud305 \ubaa8\ub378\uacfc Llama 3.3\n\n**\uac1c\uc694:**  \nAI \uc5d0\uc774\uc804\ud2b8\uac00 \uc2dd\ubcc4\ud569\ub2c8\ub2e4:  \n- \uad8c\ud55c \ubd80\uc5ec URI  \n- \ud1a0\ud070 URI  \n- \ub300\uc0c1  \n\n**\ubc29\ubc95\ub860:**  \n\ucd94\ucd9c\ub41c \ub370\uc774\ud130\uc758 \uc2e0\ub8b0\uc131\uc744 \ud3c9\uac00\ud558\uae30 \uc704\ud574 \uc2e0\ub8b0 \uc810\uc218\uac00 \ud65c\uc6a9\ub429\ub2c8\ub2e4:  \n- \uc810\uc218 \ubc94\uc704: 0 < x \u2264 1  \n- \uc810\uc218 \uc138\ubc00\ub3c4: 0.01 \uc99d\uac00  \n\n**\ubaa8\ub378 \uc138\ubd80\uc0ac\ud56d:**  \nWayfarer Large 70b Llama 3.3 \ubaa8\ub378\uc744 \ud65c\uc6a9\ud569\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "e3abf498-e9ca-482e-9e75-4a4db0bbb813",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        180
      ],
      "parameters": {
        "width": 280,
        "height": 560,
        "content": "## \uc2dc\uc791  \n**\ud2b8\ub9ac\uac70** \uc785\ub825 \ud638\ucd9c \ud504\ub85c\uc138\uc2a4\uc5d0\uc11c."
      },
      "typeVersion": 1
    },
    {
      "id": "2359628b-7f58-4f04-ac94-7d33f6bf9b0e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        180
      ],
      "parameters": {
        "color": 5,
        "height": 560,
        "content": "AI \uc5d0\uc774\uc804\ud2b8  \n**\ud504\ub86c\ud504\ud2b8** \uc785\ub825\uc744 \ub370\uc774\ud130 \ucc3e\uae30."
      },
      "typeVersion": 1
    },
    {
      "id": "e6977545-9559-45e5-a9ee-c131cc6f021b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        180
      ],
      "parameters": {
        "color": 5,
        "height": 560,
        "content": "\ud30c\uc11c\ub97c \uc0ac\uc6a9\ud558\uc5ec AI \uacb0\uacfc\ub97c \uc9c0\uc815\ub41c \uc2a4\ud0a4\ub9c8\uc5d0 \ub530\ub77c JSON \uad6c\uc870\ub85c \uac00\uc838\uc635\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "9216c88f-2c79-458e-9583-9fc718a78ea2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        180
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 560,
        "content": "\ud504\ub85c\uc138\uc2a4 \uae30\ub300\uce58\uc5d0 \ucd9c\ub825\uc744 \ub9de\ucd94\uc138\uc694."
      },
      "typeVersion": 1
    },
    {
      "id": "18b261ec-e2c2-4ce8-a61d-72397ecb328d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -200
      ],
      "parameters": {
        "color": 7,
        "width": 1500,
        "height": 940,
        "content": "## \ubaa9\uc801  \n\uc774 \ud15c\ud50c\ub9bf\uc740 AI \uae30\ubc18 \uc778\uc0ac\uc774\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec OAuth2 \uc124\uc815\uc744 \uc5bb\ub294 \ub370 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ub3c4\uc6c0\uc744 \uc8fc\uae30 \uc704\ud574 \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uac1c\ubc1c\uc790, IT \uc804\ubb38\uac00, \ub610\ub294 OAuth2 \uc778\uc99d\uc774 \ud544\uc694\ud55c API\ub97c \ub2e4\ub8e8\ub294 \ubaa8\ub4e0 \uc0ac\ub78c\uc5d0\uac8c \uc774\uc0c1\uc801\uc785\ub2c8\ub2e4. AI \uc5d0\uc774\uc804\ud2b8\ub97c \ud1b5\ud574 `authorization_url`, `token_url`, \ubc0f `audience`\uc640 \uac19\uc740 \uc8fc\uc694 \uc138\ubd80 \uc0ac\ud56d\uc744 \ucd94\ucd9c\ud558\uace0 \uac80\uc99d\ud558\ub294 \ud504\ub85c\uc138\uc2a4\ub97c \uac04\uc18c\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.  \n\n## \uac00\uce58  \nAI\ub97c \ud1b5\ud574 OAuth2 \uc138\ubd80 \uc0ac\ud56d\uc744 \uc5bb\ub294 \uac83\uc740 \uc2dc\uac04\uc744 \uc808\uc57d\ud558\uace0 \uc778\uac04 \uc624\ub958\uc758 \uc704\ud5d8\uc744 \uc904\uc5ec\uc90d\ub2c8\ub2e4. \uc2e0\ub8b0\ub3c4 \uc810\uc218 \uc2dc\uc2a4\ud15c\uc740 \uacb0\uacfc\uc758 \uc2e0\ub8b0\uc131\uc744 \ub098\ud0c0\ub0b4\uc5b4 \uc0ac\uc6a9\uc790\uac00 \uc815\ubcf4\uc5d0 \uae30\ubc18\ud55c \uacb0\uc815\uc744 \ub0b4\ub9b4 \uc218 \uc788\ub3c4\ub85d \ud569\ub2c8\ub2e4.  \n## \uc124\uc815 \uc9c0\uce68  \n### 1. \uad6c\uc131 \ub178\ub4dc  \n- **\uad6c\uc870\ud654\ub41c \ucd9c\ub825 \ub178\ub4dc**: \ubbf8\ub9ac \uc815\uc758\ub41c JSON \uc2a4\ud0a4\ub9c8\ub97c \uc0ac\uc6a9\ud558\uc5ec AI \ubaa8\ub378\uc758 \ucd9c\ub825\uc744 \uad6c\ubb38 \ubd84\uc11d\ud569\ub2c8\ub2e4. \uc774\ub294 \ub370\uc774\ud130\ub97c \ud6c4\uc18d \ucc98\ub9ac\uc5d0 \uc801\ud569\ud558\uac8c \uad6c\uc870\ud654\ud569\ub2c8\ub2e4.  \n- **\ucf54\ub4dc \ub178\ub4dc**: AI \ubaa8\ub378\uc758 \ucd9c\ub825\uc774 \ud544\uc694\ud55c \ud615\uc2dd\uacfc \uc77c\uce58\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0, \ucf54\ub4dc \ub178\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc7ac\ubc30\uce58\ud558\uace0 \ubcc0\ud658\ud569\ub2c8\ub2e4. \uc77c\ubc18\uc801\uc778 \uc2dc\ub098\ub9ac\uc624\uc5d0 \ub300\ud55c \uc608\uc81c \ucf54\ub4dc \uc2a4\ub2c8pet\uc774 \uc544\ub798\uc5d0 \uc81c\uacf5\ub429\ub2c8\ub2e4.  \n### 2. AI \ubaa8\ub378 \ud504\ub86c\ud504\ud2b8  \nAI \ubaa8\ub378\uc758 \ud504\ub86c\ud504\ud2b8\uc5d0\ub294 \ub2e4\uc74c\uc774 \ud3ec\ud568\ub429\ub2c8\ub2e4:  \n- \ucffc\ub9ac\uc758 \uc138\ubd80 \uad6c\uc870 \ubc0f \ubaa9\ud45c.  \n- \uc815\ud655\ud55c \uacb0\uacfc\ub97c \uacb0\uc815\ud560 \uc218 \uc5c6\uc744 \ub54c \ubaa8\ub378\uc774 \uc989\ud765\uc801\uc73c\ub85c \ub300\uc751\ud560 \uc218 \uc788\ub294 \uc720\uc5f0\uc131.  \n### 3. \uc2e0\ub8b0\ub3c4 \uc810\uc218  \nAI \ubaa8\ub378\uc740 \ucd94\ucd9c\ub41c \ub370\uc774\ud130\uc758 \uc2e0\ub8b0\uc131\uc744 \ub098\ud0c0\ub0b4\uae30 \uc704\ud574 0 < x \u2264 1\uc758 \uc2e0\ub8b0\ub3c4 \uc810\uc218\ub97c \ud560\ub2f9\ud569\ub2c8\ub2e4. \uc810\uc218\ub294 0.01 \ub2e8\uc704\ub85c \uc138\ubd84\ud654\ub418\uc5b4 \uc81c\uacf5\ub429\ub2c8\ub2e4.  \n\n## \uad6c\uc131 \uc608\uc81c  \n\ucf54\ub4dc \ub178\ub4dc\ub97c \uc7ac\uad6c\uc131\ud558\uae30 \uc704\ud55c \uc608\uc81c\uc785\ub2c8\ub2e4:  \n```const items =$input.all();  \nconst originalText = items[0].json.output.text;  \nconst lines = originalText.split('\\n');  \nconst service_name = lines[0].split(': ')[1];  \nconst audience = lines[1].split(': ')[1];  \nconst authorization_uri = lines[2].split(': ')[1];  \nconst token_uri = lines[3].split(': ')[1];  \nconst details = lines[4].split(': ')[1];  \nconst confidence = parseFloat(lines[5].split(': ')[1]);  \nreturn [  \n  {  \n    json: {  \n      output: {  \n        service_name,  \n        audience,  \n        authorization_uri,  \n        token_uri,  \n        details,  \n        confidence  \n      }  \n    }  \n  }  \n];  \n```  \n\n### \ucd9c\ub825"
      },
      "typeVersion": 1
    },
    {
      "id": "05edd9e4-e2ad-4dc5-930e-44aa814c07b2",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        760
      ],
      "parameters": {
        "color": 6,
        "width": 2620,
        "content": "## \uc801\uc751\uc131\n**\ucee4\uc2a4\ud130\ub9c8\uc774\uc988** \uc774 \ud15c\ud50c\ub9bf:\n* AI \ubaa8\ub378 \ud504\ub86c\ud504\ud2b8\ub97c API \ub610\ub294 OAuth2 \uc124\uc815\uc5d0 \ud2b9\uc815\ud55c \uc138\ubd80 \uc0ac\ud56d\uc73c\ub85c \uc5c5\ub370\uc774\ud2b8\ud558\uc138\uc694.\n* Structured Output \ub178\ub4dc\uc758 JSON \uc2a4\ud0a4\ub9c8\ub97c \ub370\uc774\ud130 \ud615\uc2dd\uc5d0 \ub9de\uac8c \uc870\uc815\ud558\uc138\uc694.\n* \ucf54\ub4dc \ub85c\uc9c1\uc744 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc694\uad6c\uc0ac\ud56d\uc5d0 \ub9de\uac8c \uc218\uc815\ud558\uc138\uc694."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c1321677-4ea5-4c8c-8742-02ffd4c8ef70",
  "connections": {
    "LLM Bus": {
      "main": [
        [
          {
            "node": "Conform JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "LLM Bus",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "LLM Bus",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "LLM Bus",
            "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

Ehuvg2I1Voyj0U6K My Workflow. Uses executeWorkflowTrigger, chainLlm, outputParserStructured, lmChatOpenRouter. Event-driven trigger; 12 nodes.

Source: https://github.com/n8nKOR/n8n-shared-workflow/blob/62a671327e906c22a40d290b339ff6d2373f8d75/workflows/n8n-workflows-by-Zie619/devops/eHuvG2I1vOYj0U6k_My_workflow.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

ESG analysts, investors, procurement teams, activists and sustainability professionals who need comprehensive, objective assessments of companies' environmental impact and animal welfare policies. Per

OpenRouter Chat, Output Parser Structured, Execute Workflow Trigger +1
General

Stickynote Executeworkflow. Uses executeWorkflowTrigger, chainLlm, outputParserStructured, lmChatOpenRouter. Event-driven trigger; 12 nodes.

Execute Workflow Trigger, Chain Llm, Output Parser Structured +1
General

Overview: The AI agent identifies: Authorization URI Token URI Audience

Execute Workflow Trigger, Chain Llm, Output Parser Structured +1
General

This workflow is ideal for outreach specialists, fundraisers, campaigners, and professionals who want to build authentic connections by researching prospects deeply and strategically. It helps users u

Execute Workflow Trigger, OpenRouter Chat, Chain Llm
General

Executecommand Localfile. Uses localFileTrigger, executeCommand, lmChatMistralCloud, outputParserStructured. Event-driven trigger; 16 nodes.

Local File Trigger, Execute Command, Lm Chat Mistral Cloud +2