My workflow 1 look like this
{
“nodes”: \[
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “n8n-lark-to-webhook-listener”,
“authentication”: “basicAuth”,
“responseMode”: “responseNode”,
“options”: {}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2.1,
“position”: \[
-608,
448
\],
“id”: “bcd84fca-92db-4cc0-b7aa-192f16a8c129”,
“name”: “Lark listener”,
“webhookId”: “d364e6bd-bb35-4a53-8e83-df5c4388572e”,
“credentials”: {
“httpBasicAuth”: {
“id”: “r9mgjrXU1qnt55Sq”,
“name”: “lark-to-n8n”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: \[
{
“id”: “74babfca-2109-4f97-9e55-42b726deef1e”,
“leftValue”: “={{ $json.query }}”,
“rightValue”: “\[^\\x00-\\x7F\]”,
“operator”: {
“type”: “string”,
“operation”: “notRegex”
}
}
\],
“combinator”: “or”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: \[
-208,
448
\],
“id”: “3fb86ec0-60ec-4f59-94c6-ead44628a96d”,
“name”: “If”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=Translate this >> {{ $json.query }}\\n”,
“options”: {
“systemMessage”: “You are translator who aware of thai language to english which always looking for some specific keyword to make an exception such as student’s class or student’s school results retuen must not include double quote, only return the translated rusult without the command you gave”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2.2,
“position”: \[
16,
512
\],
“id”: “257c9364-d7ea-484b-bedb-8bc2d114e1c0”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: {
“\__rl”: true,
“value”: “gpt-4o”,
“mode”: “list”,
“cachedResultName”: “gpt-4o”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: \[
16,
688
\],
“id”: “7c73a618-e4d4-45c9-ac95-f0dc4299a202”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “LTALH8M8UkR0YTWn”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: \[
{
“id”: “f9aef9eb-e64e-4246-9d3b-c22b3248b722”,
“name”: “query”,
“value”: “={{ $json.body.queryContent }}”,
“type”: “string”
}
\]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: \[
-400,
448
\],
“id”: “6c272e23-997c-45a5-be5f-756a1fad440c”,
“name”: “Select only text content”
},
{
“parameters”: {
“mode”: “raw”,
“jsonOutput”: "={\\n "fromLarkFinalQuery": "{{ $json.query }}"\\n} ",
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: \[
16,
304
\],
“id”: “02d941f6-d6b7-4270-9c19-e065fd716461”,
“name”: “fromLarkFinalQuery”
},
{
“parameters”: {
“mode”: “raw”,
“jsonOutput”: "={\\n "fromLarkFinalQuery": "{{ $json.output }}"\\n} ",
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: \[
320,
512
\],
“id”: “fd5abab3-280f-4d0c-8cd9-d3c92fa25a86”,
“name”: “fromLarkFinalQuery OpenAI”
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://2536951710982325.5.gcp.databricks.com/api/2.2/jobs/run-now”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBearerAuth”,
“sendQuery”: true,
“specifyQuery”: “json”,
“jsonQuery”: "={\\n "job_id" : "569943055844936"\\n}\\n ",
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={\\n"job_id" : "569943055844936",\\n"notebook_params" : {\\n"queryContent" : "{{ $json.fromLarkFinalQuery }}"\\n}\\n}”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: \[
512,
304
\],
“id”: “20458962-b5f6-4e8c-8df9-4fe03f276494”,
“name”: “HTTP Request to Databrick”,
“credentials”: {
“httpBearerAuth”: {
“id”: “yIM9hKjEcs0QRBeM”,
“name”: “Databrick - Bearer Auth account”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://2536951710982325.5.gcp.databricks.com/api/2.2/jobs/run-now”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBearerAuth”,
“sendQuery”: true,
“specifyQuery”: “json”,
“jsonQuery”: "={\\n "job_id" : "569943055844936"\\n}\\n ",
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={\\n"job_id" : "569943055844936",\\n"notebook_params" : {\\n"queryContent" : "{{ $json.fromLarkFinalQuery }}"\\n}\\n}”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: \[
512,
512
\],
“id”: “6e21efa0-04f5-4b04-add2-5571beaa5fdd”,
“name”: “HTTP Request to Databrick1”,
“credentials”: {
“httpBearerAuth”: {
“id”: “yIM9hKjEcs0QRBeM”,
“name”: “Databrick - Bearer Auth account”
}
}
},
{
“parameters”: {
“respondWith”: “json”,
“responseBody”: “{{ JSON.stringify($input.all()\[0\].json) }}”,
“options”: {}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.4,
“position”: \[
1088,
304
\],
“id”: “dc563eb2-c582-4b5d-b833-e78f76aff26f”,
“name”: “Respond to Webhook”,
“disabled”: true
},
{
“parameters”: {
“respondWith”: “json”,
“responseBody”: “{{ JSON.stringify($input.all()\[0\].json) }}”,
“options”: {}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.4,
“position”: \[
1088,
512
\],
“id”: “435871a0-a212-4586-b445-7fd4eeb85cc5”,
“name”: “Respond to Webhook1”,
“disabled”: true
},
{
“parameters”: {
“workflowId”: {
“\__rl”: true,
“value”: “vRbVE289duanAqV4”,
“mode”: “list”,
“cachedResultName”: “Knowledge based project — Databrick listener sub-workflow”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: [ ],
“schema”: [ ],
“attemptToConvertTypes”: false,
“convertFieldsToString”: true
},
“options”: {
“waitForSubWorkflow”: true
}
},
“type”: “n8n-nodes-base.executeWorkflow”,
“typeVersion”: 1.2,
“position”: \[
704,
304
\],
“id”: “bfcee77c-8248-424e-b839-8c3ab2b0bc4f”,
“name”: “Databrick listening”,
“disabled”: true
},
{
“parameters”: {
“workflowId”: {
“\__rl”: true,
“value”: “vRbVE289duanAqV4”,
“mode”: “list”,
“cachedResultName”: “Knowledge based project — Databrick listener sub-workflow”
},
“workflowInputs”: {
“mappingMode”: “defineBelow”,
“value”: {},
“matchingColumns”: [ ],
“schema”: [ ],
“attemptToConvertTypes”: false,
“convertFieldsToString”: true
},
“options”: {
“waitForSubWorkflow”: true
}
},
“type”: “n8n-nodes-base.executeWorkflow”,
“typeVersion”: 1.2,
“position”: \[
704,
512
\],
“id”: “37b60f5d-5cc4-4c8a-9193-ca1dfe5384ed”,
“name”: “Databrick listening1”,
“disabled”: true
},
{
“parameters”: {
“amount”: 2,
“unit”: “minutes”
},
“type”: “n8n-nodes-base.wait”,
“typeVersion”: 1.1,
“position”: \[
896,
512
\],
“id”: “540c2cee-6d17-499b-a003-3cdc541bf8a0”,
“name”: “Wait”,
“webhookId”: “c81ea56e-2cbb-4d62-b137-8f97cad6d166”,
“disabled”: true
},
{
“parameters”: {
“amount”: 2,
“unit”: “minutes”
},
“type”: “n8n-nodes-base.wait”,
“typeVersion”: 1.1,
“position”: \[
896,
304
\],
“id”: “16586515-1ad1-4cba-a525-d44264189c60”,
“name”: “Wait1”,
“webhookId”: “c81ea56e-2cbb-4d62-b137-8f97cad6d166”,
“disabled”: true
}
\],
“connections”: {
“Lark listener”: {
“main”: \[
\[
{
“node”: “Select only text content”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“If”: {
“main”: \[
\[
{
“node”: “fromLarkFinalQuery”,
“type”: “main”,
“index”: 0
}
\],
\[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“AI Agent”: {
“main”: \[
\[
{
“node”: “fromLarkFinalQuery OpenAI”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“OpenAI Chat Model”: {
“ai_languageModel”: \[
\[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
\]
\]
},
“Select only text content”: {
“main”: \[
\[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“fromLarkFinalQuery”: {
“main”: \[
\[
{
“node”: “HTTP Request to Databrick”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“fromLarkFinalQuery OpenAI”: {
“main”: \[
\[
{
“node”: “HTTP Request to Databrick1”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“HTTP Request to Databrick”: {
“main”: \[
\[
{
“node”: “Databrick listening”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“HTTP Request to Databrick1”: {
“main”: \[
\[
{
“node”: “Databrick listening1”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“Respond to Webhook”: {
“main”: \[
[ ]
\]
},
“Databrick listening”: {
“main”: \[
\[
{
“node”: “Wait1”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“Databrick listening1”: {
“main”: \[
\[
{
“node”: “Wait”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“Wait”: {
“main”: \[
\[
{
“node”: “Respond to Webhook1”,
“type”: “main”,
“index”: 0
}
\]
\]
},
“Wait1”: {
“main”: \[
\[
{
“node”: “Respond to Webhook”,
“type”: “main”,
“index”: 0
}
\]
\]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “0468f76c80d61f1e4ff92210c64de7e69e9bb1b7f99550f2e12e2e965f8f8a43”
}
}
the rusults from HTTP request databrick will be the one who trigger Databrick listener in that sub-workflow (the workflow on this topic)