This workflow follows the Airtable → HTTP Request 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 →
{
"active": false,
"connections": {
"Unipile - On New Message": {
"main": [
[
{
"node": "Setting Variables",
"type": "main",
"index": 0
}
]
]
},
"Setting Variables": {
"main": [
[
{
"node": "Remove Cases We Don't Handle",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Download Audio": {
"main": [
[
{
"node": "Translate / Transcribe to Text",
"type": "main",
"index": 0
}
]
]
},
"Translate / Transcribe to Text": {
"main": [
[
{
"node": "Translation if Needed",
"type": "main",
"index": 0
}
]
]
},
"Remove Cases We Don't Handle": {
"main": [
[
{
"node": "Check for Audio",
"type": "main",
"index": 0
}
]
]
},
"Check for Audio": {
"main": [
[
{
"node": "Unipile: Download Audio",
"type": "main",
"index": 0
}
],
[
{
"node": "Only Accept Command Prefix",
"type": "main",
"index": 0
}
]
]
},
"Filter Valid Attendee Names": {
"main": [
[
{
"node": "Filter Valid Command + Message",
"type": "main",
"index": 0
}
]
]
},
"Only Accept Command Prefix": {
"main": [
[
{
"node": "Filter Valid Attendee Names",
"type": "main",
"index": 0
}
]
]
},
"Translation if Needed": {
"main": [
[
{
"node": "Unipile: Send Transcription",
"type": "main",
"index": 0
}
]
]
},
"Filter Valid Command + Message": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "AI Chat System",
"type": "main",
"index": 0
}
],
[
{
"node": "Perplexity API - Sonar Pro",
"type": "main",
"index": 0
}
],
[
{
"node": "Unipile: Send Start Message for DeepSearch",
"type": "main",
"index": 0
}
],
[
{
"node": "Unipile: Send Start Message for Image Gen",
"type": "main",
"index": 0
}
],
[
{
"node": "Unipile: Send Start Message for Music Gen",
"type": "main",
"index": 0
}
],
[],
[
{
"node": "Unipile: Send Intro",
"type": "main",
"index": 0
}
]
]
},
"AI Chat System": {
"main": [
[
{
"node": "Unipile: Send AI Chat Result",
"type": "main",
"index": 0
}
]
]
},
"Perplexity API - Sonar Pro": {
"main": [
[
{
"node": "Unipile: Send AI Chat w/ Search Results",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send Start Message for DeepSearch": {
"main": [
[
{
"node": "Perplexity API - Deep Research",
"type": "main",
"index": 0
}
]
]
},
"Perplexity API - Deep Research": {
"main": [
[
{
"node": "Unipile: Send Deep Research",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send Start Message for Image Gen": {
"main": [
[
{
"node": "Leonardo.ai - Generate Flux Image",
"type": "main",
"index": 0
}
]
]
},
"Leonardo.ai - Generate Flux Image": {
"main": [
[
{
"node": "Airtable: Create Image Record",
"type": "main",
"index": 0
}
]
]
},
"Airtable: Search for Gen ID": {
"main": [
[
{
"node": "Download Image",
"type": "main",
"index": 0
}
]
]
},
"Leonardo.ai Webhook": {
"main": [
[
{
"node": "Airtable: Search for Gen ID",
"type": "main",
"index": 0
}
]
]
},
"Download Image": {
"main": [
[
{
"node": "Unipile: Send Image",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send Image": {
"main": [
[
{
"node": "Wait 3 Secs",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send Message": {
"main": [
[
{
"node": "Airtable: Save Image",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send Start Message for Music Gen": {
"main": [
[
{
"node": "SunoAPI.org: Generate 2 Songs",
"type": "main",
"index": 0
}
]
]
},
"SunoAPI.org: Generate 2 Songs": {
"main": [
[
{
"node": "Airtable: Create Song Record",
"type": "main",
"index": 0
}
]
]
},
"SunoAPI.org Webhook": {
"main": [
[
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"Filter": {
"main": [
[
{
"node": "Airtable: Search for Task ID",
"type": "main",
"index": 0
}
]
]
},
"Airtable: Search for Task ID": {
"main": [
[
{
"node": "Airtable: Save Songs",
"type": "main",
"index": 0
}
]
]
},
"Download 1st Song": {
"main": [
[
{
"node": "Rename 1st Song",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send 1st Song": {
"main": [
[
{
"node": "Download 2nd Song",
"type": "main",
"index": 0
}
]
]
},
"Airtable: Save Songs": {
"main": [
[
{
"node": "Download 1st Song",
"type": "main",
"index": 0
}
]
]
},
"Rename 1st Song": {
"main": [
[
{
"node": "Unipile: Send 1st Song",
"type": "main",
"index": 0
}
]
]
},
"Download 2nd Song": {
"main": [
[
{
"node": "Rename 2nd Song",
"type": "main",
"index": 0
}
]
]
},
"Rename 2nd Song": {
"main": [
[
{
"node": "Unipile: Send 2nd Song",
"type": "main",
"index": 0
}
]
]
},
"Unipile: Send 2nd Song": {
"main": [
[
{
"node": "Wait 4 Secs",
"type": "main",
"index": 0
}
]
]
},
"Wait 3 Secs": {
"main": [
[
{
"node": "Unipile: Send Message",
"type": "main",
"index": 0
}
]
]
},
"Wait 4 Secs": {
"main": [
[
{
"node": "Unipile: Send Confirm Message",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2025-07-16T20:55:25.958Z",
"id": "xD8rusB2lpA7kLvA",
"isArchived": false,
"meta": null,
"name": "OASIS",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "df52bfe7-3048-4491-b46e-efbefba2cc09",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-1200,
120
],
"id": "779022ac-a0ff-4190-9f2c-c89bebe9879f",
"name": "Unipile - On New Message"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "6c697f38-5da2-4338-b682-96aad1e166ec",
"name": "audio_attachment",
"value": "=audio",
"type": "string"
},
{
"id": "f4a27dd8-35aa-4900-a350-8edcc889875e",
"name": "whatsapp_attendee_name",
"value": "put your whatsapp attendee name here, example: 7323249941@s.whatsapp.net",
"type": "string"
},
{
"id": "fa09eb1f-9ae3-4c2b-8b18-8bdc215696e4",
"name": "whatsapp_attendee_name_v2",
"value": "whatsapp attendee name - if you have a name instead of a phone number such as 'Max Gibson'",
"type": "string"
},
{
"id": "e95d80cd-7102-46a3-b1fb-facc9bac2842",
"name": "linkedin_attendee_name",
"value": "Linkedin Attendee Name like 'Max Gibson'",
"type": "string"
},
{
"id": "f57582f6-6f8b-4831-b5b4-e84bc0f2b251",
"name": "telegram_attendee_name",
"value": "Telegram Attendee Name like 'Max Gibson'",
"type": "string"
},
{
"id": "2a14a968-4774-4120-bfc1-4dcc0a3e17b0",
"name": "song_finished_callback",
"value": "the webhook to receive the song results, example - https://n8n.yourdomain.com/webhook/98734-897234-238974-34897",
"type": "string"
},
{
"id": "08b6a303-93b0-4c43-adf3-61fed71e1f5d",
"name": "unipile_dsn",
"value": "Your Unipile DSN, such as 'api3.unipile.com:11826'",
"type": "string"
},
{
"id": "93bf2cc4-8c01-42a2-8b57-f8cd2bea0536",
"name": "command_prefix",
"value": "/",
"type": "string"
},
{
"id": "f0d040fd-6c26-4c0e-81de-b0282e3ad998",
"name": "assistant_name",
"value": "Oasis",
"type": "string"
},
{
"id": "f2cf8ed5-e1fa-4a37-9e4a-0fe6b8922830",
"name": "message",
"value": "={{ $json.body.message }}",
"type": "string"
},
{
"id": "23dc80c8-cb32-481c-88fa-1c3bf2896f63",
"name": "command_ai_chat",
"value": "chat",
"type": "string"
},
{
"id": "49d88934-a811-461d-88e9-cf9d200c86d6",
"name": "command_websearch_ai_chat",
"value": "search",
"type": "string"
},
{
"id": "70d5e821-ee9e-4120-a94a-206284a3d397",
"name": "command_deep_research",
"value": "deepsearch",
"type": "string"
},
{
"id": "d4e3ecd7-19da-4b1e-b44e-375848978bca",
"name": "command_compose",
"value": "compose",
"type": "string"
},
{
"id": "75f47fcd-d81a-48d1-b038-3cd37392c030",
"name": "command_imagine",
"value": "imagine",
"type": "string"
},
{
"id": "e8ab0736-7e1b-4c6a-8875-ddef2ad2d75d",
"name": "command_introduction",
"value": "intro",
"type": "string"
},
{
"id": "07c12f1b-91d3-4ede-825d-e5758bf6d2f6",
"name": "command_sales_pitch",
"value": "pitch",
"type": "string"
},
{
"id": "e96bbe4a-e4d8-4ae1-9a2d-5006560c7ba7",
"name": "principal_name",
"value": "Max aka Mosheh",
"type": "string"
},
{
"id": "856fda5d-67a7-4698-bc76-71a99a16804f",
"name": "introduction_text",
"value": "=Type your professional introduction here!",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1200,
440
],
"id": "30dfa5ac-0932-4259-b886-15f0744de087",
"name": "Setting Variables"
},
{
"parameters": {
"resource": "audio",
"operation": "transcribe",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
-600,
420
],
"id": "bf273eb9-9116-4aff-be54-bcf56b309ec5",
"name": "Translate / Transcribe to Text"
},
{
"parameters": {
"url": "=https://{{ $json.unipile_dsn }}/api/v1/messages/{{ $('Unipile - On New Message').item.json.body.message_id }}/attachments/{{ $('Unipile - On New Message').item.json.body.attachments[0].attachment_id }}",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-600,
220
],
"id": "f9347253-af48-40db-ae77-f533c0488c3f",
"name": "Unipile: Download Audio",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "6e68ebfd-3a51-4e7c-9b1f-af74b1a86f5a",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.attachments[0].attachment_type }}",
"rightValue": "={{ $json.audio_attachment }}",
"operator": {
"type": "string",
"operation": "contains"
}
},
{
"id": "ad142e2c-dd66-448c-acc1-50896e1f4da9",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.sender.attendee_name }}",
"rightValue": "={{ $json.linkedin_attendee_name }}",
"operator": {
"type": "string",
"operation": "contains"
}
},
{
"id": "b770bb2c-5477-47a9-8965-1bd5143d898b",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.sender.attendee_name }}",
"rightValue": "={{ $json.telegram_attendee_name }}",
"operator": {
"type": "string",
"operation": "contains"
}
},
{
"id": "88432a4f-04ee-46cd-aa04-302f75532738",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.sender.attendee_name }}",
"rightValue": "={{ $json.whatsapp_attendee_name }}",
"operator": {
"type": "string",
"operation": "contains"
}
},
{
"id": "86072e31-9a9a-4b1d-8c99-135c04898f0d",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.sender.attendee_name }}",
"rightValue": "={{ $json.whatsapp_attendee_name_v2 }}",
"operator": {
"type": "string",
"operation": "contains"
}
}
],
"combinator": "or"
},
"options": {
"ignoreCase": true
}
},
"type": "n8n-nodes-base.filter",
"typeVersion": 2.2,
"position": [
-1020,
440
],
"id": "54f2179e-8a45-4aa8-915f-f8864363bf23",
"name": "Remove Cases We Don't Handle"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "de3d5c14-218c-4169-b35b-4e63e78da94d",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.attachments[0].attachment_type }}",
"rightValue": "={{ $('Setting Variables').item.json.audio_attachment }}",
"operator": {
"type": "string",
"operation": "contains"
}
},
{
"id": "97963984-cdbb-4151-b4a4-263523fa0c27",
"leftValue": "={{ $('Unipile - On New Message').item.json.body.attendees[0].attendee_provider_id }}",
"rightValue": "8161666740",
"operator": {
"type": "string",
"operation": "notEquals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-840,
420
],
"id": "259d5827-493d-48e7-bad8-5b25ad9d144e",
"name": "Check for Audio"
},
{
"parameters": {
"jsCode": "// Grab the JSON from \"Setting Variables\" Node\nconst configData = $node[\"Setting Variables\"].json\n// Create our Valid Names Array\nconst validNames = [\n configData.whatsapp_attendee_name,\n configData.linkedin_attendee_name,\n configData.telegram_attendee_name,\n configData.whatsapp_attendee_name_v2 \n];\n\n// Get the attendee_name from the incoming JSON\nconst attendeeName = $node[\"Unipile - On New Message\"].json.body.sender.attendee_name;\n\n// Check if it matches any valid value and output only attendee_name\nif (validNames.includes(attendeeName)) {\n return [{ json: { attendee_name: attendeeName } }];\n} else {\n return []; // No output if it doesn\u2019t match\n}"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-620,
760
],
"id": "80f09f7e-a74b-4c66-a6ce-cfd281593353",
"name": "Filter Valid Attendee Names"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "88432a4f-04ee-46cd-aa04-302f75532738",
"leftValue": "={{ $json.message }}",
"rightValue": "={{ $('Setting Variables').item.json.command_prefix }}",
"operator": {
"type": "string",
"operation": "startsWith"
}
}
],
"combinator": "or"
},
"options": {
"ignoreCase": true
}
},
"type": "n8n-nodes-base.filter",
"typeVersion": 2.2,
"position": [
-820,
760
],
"id": "ca4b0085-7ab8-4ddc-9f9d-915e189d9a24",
"name": "Only Accept Command Prefix"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "GPT-4O-MINI"
},
"messages": {
"values": [
{
"content": "Translate User INPUT into english if it is not already. Output in JSON format:\n\n{\n \"output\": \"<original text if english OR text translated into english>\n}",
"role": "assistant"
},
{
"content": "=INPUT:\n{{ $json.text }}"
}
]
},
"jsonOutput": true,
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
-420,
220
],
"id": "04b1df07-ad4d-48fa-bc83-ab82333d6afe",
"name": "Translation if Needed"
},
{
"parameters": {
"jsCode": "// Grab the JSON from \"Setting Variables\" Node\nconst configData = $node[\"Setting Variables\"].json;\n\n// Create our Valid Commands Array\nconst validCommands = [\n configData.command_ai_chat, // \"chat\"\n configData.command_websearch_ai_chat, // \"search\"\n configData.command_deep_research, // \"deepsearch\"\n configData.command_compose, // \"compose\"\n configData.command_imagine, // \"imagine\"\n configData.command_introduction, // \"introduction\"\n configData.command_sales_pitch // \"sales pitch\"\n];\n\n// Get the command prefix\nconst prefix = configData.command_prefix; // \"/\"\n\n// Get the message from the incoming JSON\nconst fullMessage = $node[\"Unipile - On New Message\"].json.body.message;\n\n// Extract the command from the message\nconst command = fullMessage.startsWith(prefix) \n ? fullMessage.split(\" \")[0].substring(prefix.length) // Remove prefix, e.g., \"chat\" from \"/chat\"\n : \"\";\n\n// Check if the command matches any valid value and split the message\nif (validCommands.includes(command)) {\n // Extract the message content after the command\n const messageContent = fullMessage.substring(prefix.length + command.length).trim();\n return [{ json: { command: command, message: messageContent } }];\n} else {\n return []; // No output if the command doesn\u2019t match\n}"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-420,
760
],
"id": "47e0e78b-00c5-4e26-84d9-80eb79861521",
"name": "Filter Valid Command + Message"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_ai_chat }}",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "98132085-64c6-47a5-b233-af11b8111157"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "AI Chat"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "4155058a-b9a7-458d-bfa2-bd442027bf71",
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_websearch_ai_chat }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "AI Chat w/ WebSearch"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "a2d4ba26-cc69-46b8-84aa-93961afd9452",
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_deep_research }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Deep Researcher"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "3be5c724-0ce3-4915-8a80-4ceb2926937d",
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_imagine }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Image Gen"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "60c935c7-4390-4f98-af24-da1b8c66794a",
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_compose }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Music Gen"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "8f50747e-f306-4738-afd1-068362add51c",
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_sales_pitch }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Sales Pitch"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "119c9aa9-93d6-43cd-a3d6-d4fc7bf24f4d",
"leftValue": "={{ $json.command }}",
"rightValue": "={{ $('Setting Variables').item.json.command_introduction }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Introduction"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-240,
660
],
"id": "31bb3105-a7f2-4d44-8882-42414f2e0871",
"name": "Switch"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}: Transcription/Translation]: {{ $json.message.content.output }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-340,
420
],
"id": "78fb0fec-88a7-475b-bb04-fdc2546f9c82",
"name": "Unipile: Send Transcription",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"content": "## Transcription Service",
"height": 460,
"width": 560,
"color": 2
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-660,
160
],
"typeVersion": 1,
"id": "b664c895-1206-48d3-a69b-25fe907d0904",
"name": "Sticky Note"
},
{
"parameters": {
"content": "## Command System Filtering",
"height": 340,
"width": 780
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
640
],
"typeVersion": 1,
"id": "f29e97da-a887-4209-a710-ccfb6c48c56d",
"name": "Sticky Note1"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "GPT-4O-MINI"
},
"messages": {
"values": [
{
"content": "=Your name is {{ $('Setting Variables').item.json.assistant_name }} (Omnipresent AI System for Instant Support), and you are a whatsapp chatbot. Please review the User's MESSAGE, and respond.\n\nStyle:\n- Respond in the style of: Professional Casual\n\nNote:\n- Remember you are responding in WhatsApp.. So attempt to keep your messages short and relevant.",
"role": "system"
},
{
"content": "=MESSAGE:\n{{ $json.message }}"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
80,
60
],
"id": "c20420af-ed1a-4931-8c46-62d83811b6b2",
"name": "AI Chat System"
},
{
"parameters": {
"method": "POST",
"url": "https://api.perplexity.ai/chat/completions",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"model\": \"sonar-pro\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful AI assistant.\\n\\nRules:\\n1. Provide only the final answer. It is important that you do not include any explanation on the steps below.\\n2. Do not show the intermediate steps information.\\n\\nSteps:\\n1. Decide if the answer should be a brief sentence or a list of suggestions.\\n2. If it is a list of suggestions, first, write a brief and natural introduction based on the original query.\\n3. Followed by a list of suggestions, each suggestion should be split by two newlines.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ encodeURIComponent($json.message) }}\"\n }\n ],\n \"max_tokens\": 300,\n \"temperature\": 0.2,\n \"top_p\": 0.8,\n \"search_domain_filter\": null,\n \"return_images\": false,\n \"return_related_questions\": false,\n \"top_k\": 0,\n \"stream\": false,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0.5,\n \"response_format\": null\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
140,
220
],
"id": "d73b43b3-dd42-42ea-ad0e-0ae9dabd7784",
"name": "Perplexity API - Sonar Pro"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}: AI Chat w/ Search]: {{$json.choices[0].message.content}}\n\nSources:\n{{ $json.citations.join('\\n') }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
540,
220
],
"id": "ecf4821f-48d4-4184-a175-bbf06d3f27ad",
"name": "Unipile: Send AI Chat w/ Search Results",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}: AI Chat]: {{ $json.message.content }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
540,
60
],
"id": "22251a1f-e094-4082-ae6c-5190d808b7bf",
"name": "Unipile: Send AI Chat Result",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"content": "## Command Processing",
"height": 1180,
"width": 740,
"color": 2
},
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"typeVersion": 1,
"id": "31fcc4a4-e012-4c8e-9c50-24f745f22e73",
"name": "Sticky Note3"
},
{
"parameters": {
"content": "## Set Variables, Pre-Screen for Platforms & Audio",
"height": 280,
"width": 540
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-1240,
340
],
"typeVersion": 1,
"id": "4884245b-e856-4fb1-a420-b2d292791797",
"name": "Sticky Note2"
},
{
"parameters": {
"method": "POST",
"url": "https://api.perplexity.ai/chat/completions",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"model\": \"sonar-deep-research\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an expert AI 'Deep Researcher'. Provide a very well researched report, in English, on the content provided by user\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ encodeURIComponent($('Switch').item.json.message) }}\"\n }\n ]\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
320,
400
],
"id": "dddb5087-5324-479c-8de6-2e5a1b32ea58",
"name": "Perplexity API - Deep Research"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}] \ud83d\udcd1 Give me about 2 minutes to do that \ud83e\udde0research\ud83d\udd0d for you! \ud83d\udcd6"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
120,
400
],
"id": "53e56e8c-a3ef-4934-bf40-1745a802dcb3",
"name": "Unipile: Send Start Message for DeepSearch",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}] \ud83c\udfa8 Give me a minute to imagine that \ud83d\udd8c\ufe0fimage\ud83d\udd8a\ufe0f for you! \ud83d\uddbc\ufe0f"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
120,
600
],
"id": "938ec72e-1262-4079-a242-a40c60883707",
"name": "Unipile: Send Start Message for Image Gen",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}] \ud83c\udfb5 Give me about 4 minutes to generate that \ud83c\udfa4music\ud83c\udfb8 for you boss (2 version of your request)! \ud83c\udfa7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
120,
800
],
"id": "91f0f33e-bb18-4d39-9d94-4f826114cfa9",
"name": "Unipile: Send Start Message for Music Gen",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"method": "POST",
"url": "https://cloud.leonardo.ai/api/rest/v1/generations",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"modelId\": \"6b645e3a-d64f-4341-a6d8-7a3690fbf042\",\n \"prompt\": \"{{ $('Filter Valid Command + Message').item.json.message }}\",\n \"num_images\": 1,\n \"width\": 1472,\n \"height\": 1472,\n \"styleUUID\": \"111dc692-d470-4eec-b791-3475abac4c46\",\n \"enhancePrompt\": true\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
320,
600
],
"id": "a4810ab0-9e0d-4a20-949b-d25e4125a0a2",
"name": "Leonardo.ai - Generate Flux Image"
},
{
"parameters": {
"operation": "search",
"base": {
"__rl": true,
"value": "apppl9h1H5dcZUATA",
"mode": "list",
"cachedResultName": "Oasis - Omnipresent AI System for Instant Support",
"cachedResultUrl": "https://airtable.com/apppl9h1H5dcZUATA"
},
"table": {
"__rl": true,
"value": "tblCUkA0a2RtycjDy",
"mode": "list",
"cachedResultName": "Leonardo AI",
"cachedResultUrl": "https://airtable.com/apppl9h1H5dcZUATA/tblCUkA0a2RtycjDy"
},
"filterByFormula": "={Generation ID} = \"{{ $json.body.data.object.id }}\"",
"options": {}
},
"type": "n8n-nodes-base.airtable",
"typeVersion": 2.1,
"position": [
-1180,
1060
],
"id": "a5f29570-0187-4115-8c19-a24bd9935c6c",
"name": "Airtable: Search for Gen ID"
},
{
"parameters": {
"operation": "update",
"base": {
"__rl": true,
"value": "apppl9h1H5dcZUATA",
"mode": "list",
"cachedResultName": "Oasis - Omnipresent AI System for Instant Support",
"cachedResultUrl": "https://airtable.com/apppl9h1H5dcZUATA"
},
"table": {
"__rl": true,
"value": "tblCUkA0a2RtycjDy",
"mode": "list",
"cachedResultName": "Leonardo AI",
"cachedResultUrl": "https://airtable.com/apppl9h1H5dcZUATA/tblCUkA0a2RtycjDy"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"id": "={{ $('Airtable: Search for Gen ID').item.json.id }}",
"Model Name": "={{ $('Leonardo.ai Webhook').item.json.body.data.object.model.name }}",
"Dimensions": "={{ $('Leonardo.ai Webhook').item.json.body.data.object.model.modelHeight }} x {{ $('Leonardo.ai Webhook').item.json.body.data.object.model.modelWidth }}",
"Final Prompt": "={{ $('Leonardo.ai Webhook').item.json.body.data.object.prompt }}",
"Image URL": "={{ $('Leonardo.ai Webhook').item.json.body.data.object.images[0].url }}",
"Image ID": "={{ $('Leonardo.ai Webhook').item.json.body.data.object.images[0].id }}",
"Image": "=[{\"url\":\"{{ $('Leonardo.ai Webhook').item.json.body.data.object.images[0].url }}\"}]",
"API Cost": "={{ $('Leonardo.ai Webhook').item.json.body.data.object.apiDollarCost }}"
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": false,
"defaultMatch": true,
"display": true,
"type": "string",
"readOnly": true,
"removed": false
},
{
"id": "Generation ID",
"displayName": "Generation ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "API Cost",
"displayName": "API Cost",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "number",
"readOnly": false,
"removed": false
},
{
"id": "Model Name",
"displayName": "Model Name",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Dimensions",
"displayName": "Dimensions",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Submitted Prompt",
"displayName": "Submitted Prompt",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Final Prompt",
"displayName": "Final Prompt",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Image URL",
"displayName": "Image URL",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Image",
"displayName": "Image",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "array",
"readOnly": false,
"removed": false
},
{
"id": "Image ID",
"displayName": "Image ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Unipile DSN",
"displayName": "Unipile DSN",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Chat ID",
"displayName": "Chat ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Assistant Name",
"displayName": "Assistant Name",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Created Time",
"displayName": "Created Time",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": true,
"removed": true
},
{
"id": "Record ID",
"displayName": "Record ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.airtable",
"typeVersion": 2.1,
"position": [
-300,
1060
],
"id": "5c7b1dba-d222-4941-8cac-a9e5186fca31",
"name": "Airtable: Save Image"
},
{
"parameters": {
"httpMethod": "POST",
"path": "e869ff7b-f92d-47d2-9fbc-86d89c536875",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-1380,
1060
],
"id": "ae12b871-c8c7-462b-b955-0e163a3ec610",
"name": "Leonardo.ai Webhook"
},
{
"parameters": {
"method": "POST",
"url": "=https://{{ $('Setting Variables').item.json.unipile_dsn }}/api/v1/chats/{{ $('Unipile - On New Message').item.json.body.chat_id }}/messages",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "multipart/form-data"
}
]
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "text",
"value": "=[{{ $('Setting Variables').item.json.assistant_name }}: DEEP SEARCH]:\n{{$json.choices[0].message.content}}\n\n[Sources]:\n{{ $json.citations.join('\\n') }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
540,
400
],
"id": "1978de58-bf31-42fe-bef4-3cc6fff8cd45",
"name": "Unipile: Send Deep Research",
"alwaysOutputData": true,
"onError": "continueRegularOutput"
},
{
"parameters": {
"operation": "create",
"base": {
"__rl": true,
"value": "apppl9h1H5dcZUATA",
"mode": "list",
"cachedResultName": "Oasis - Omnipresent AI System for Instant Support",
"cachedResultUrl": "https://airtable.com/apppl9h1H5dcZUATA"
},
"table": {
"__rl": true,
"value": "tblCUkA0a2RtycjDy",
"mode": "list",
"cachedResultName": "Leonardo AI",
"cachedResultUrl": "https://airtable.com/apppl9h1H5dcZUATA/tblCUkA0a2RtycjDy"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"API Cost": "={{ $json.sdGenerationJob.apiCreditCost }}",
"Generation ID": "={{ $json.sdGenerationJob.generationId }}",
"Chat ID": "={{ $('Unipile - On New Message').item.json.body.chat_id }}",
"Unipile DSN": "={{ $('Setting Variables').item.json.unipile_dsn }}",
"Submitted Prompt": "={{ $('Filter Valid Command + Message').item.json.message }}",
"Assistant Name": "={{ $('Setting Variables').item.json.assistant_name }}"
},
"matchingColumns": [],
"schema": [
{
"id": "Generation ID",
"displayName": "Generation ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "API Cost",
"displayName": "API Cost",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "number",
"readOnly": false,
"removed": false
},
{
"id": "Model Name",
"displayName": "Model Name",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Dimensions",
"displayName": "Dimensions",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Submitted Prompt",
"displayName": "Submitted Prompt",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Final Prompt",
"displayName": "Final Prompt",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Image URL",
"displayName": "Image URL",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Image",
"displayName": "Image",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "array",
"readOnly": false,
"removed": false
},
{
"id": "Image ID",
"displayName": "Image ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Unipile DSN",
"displayName": "Unipile DSN",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Chat ID",
"displayName": "Chat ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Assistant Name",
"displayName": "Assistant Name",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": false,
"removed": false
},
{
"id": "Created Time",
"displayName": "Created Time",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": true,
"removed": false
},
{
"id": "Record ID",
"displayName": "Record ID",
"required": false,
"defaultMatch": false,
"canBeUsedToMatch": true,
"display": true,
"type": "string",
"readOnly": true,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.airtable",
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
OASIS. Uses openAi, httpRequest, airtable. Webhook trigger; 51 nodes.
Source: https://github.com/julian-becker/N8N-Flows/blob/736f9ed737f40d7b11ef131ea767fbf79d4bc3c0/n8n-workflows/OASIS.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This powerful n8n automation workflow is designed to execute advanced B2B lead enrichment and hyper-personalization for cold email outreach. By orchestrating a complex chain of data scraping, AI analy
This template is perfect for e-commerce entrepreneurs, marketers, agencies, and creative teams who want to turn simple product photos and short descriptions into professional flyers or product videos—
This n8n template demonstrates how to capture inbound leads from a form, qualify them with OpenAI, and route the hottest ones to a Bland AI voice agent that calls them back, books a meeting on Google
AI-Powered Fake Review Detection Workflow Using n8n & Airtable. Uses httpRequest, airtable, openAi, slack. Webhook trigger; 27 nodes.
This workflow automatically monitors Facebook Group posts, analyzes them using AI, detects policy violations, logs incidents, notifies moderators and automatically hides high-severity posts to keep th