AutomationFlowsAI & RAG › Synka SAAS - Master Workflow (completo)

Synka SAAS - Master Workflow (completo)

Synka SaaS - Master Workflow (COMPLETO). Uses httpRequest, agent, memoryBufferWindow, lmChatGoogleGemini. Webhook trigger; 11 nodes.

Webhook trigger★★★★☆ complexityAI-powered11 nodesHTTP RequestAgentMemory Buffer WindowGoogle Gemini ChatTool Http Request
AI & RAG Trigger: Webhook Nodes: 11 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → 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 →

Download .json
{
  "name": "Synka SaaS - Master Workflow (COMPLETO)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "saas-agendamentos",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "Webhook",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        200,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://somar-clinicas-consutorios.vercel.app/api/n8n/empresa-by-whatsapp",
        "method": "GET",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "numero_wa",
              "value": "={{ $node[\"Webhook\"].json.body?.to || $node[\"Webhook\"].json.to || $node[\"Webhook\"].json.data?.to || $node[\"Webhook\"].json.destination }}"
            }
          ]
        },
        "options": {}
      },
      "id": "IdentificarEmpresa",
      "name": "Identificar Empresa",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        420,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const wh = $node['Webhook'].json;\nconst emp = $node['Identificar Empresa'].json;\n\n// Identifica\u00e7\u00e3o do Remetente (Cliente)\nconst rawFrom = wh?.data?.from || wh?.body?.data?.from || wh?.body?.from || wh?.from || wh?.sender_number || '';\nconst sessionId = rawFrom.split('@')[0] || 'default_session';\n\n// Mensagem do Cliente\nconst message = wh?.data?.body || wh?.body?.data?.body || wh?.body?.message || wh?.body?.body || wh?.message || String(wh?.body || '');\n\n// Dados da Empresa (Identificados dinamicamente)\nreturn [{\n  json: {\n    sessionId,\n    from: rawFrom,\n    message,\n    tenantId: emp.empresa_id,\n    nomeEmpresa: emp.nome_empresa,\n    systemPrompt: emp.instrucoes_ia,\n    // Fallbacks para inst\u00e2ncias de envio se n\u00e3o mapeado no DB\n    instanceId: emp.config?.instanceId || 'instance156799',\n    ultraMsgToken: emp.config?.ultraMsgToken || 'nbk60ugo4t1craq9'\n  }\n}];"
      },
      "id": "PrepareData",
      "name": "PrepareData",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "={{ $json.systemPrompt }}",
          "agent": "tools",
          "maxIterations": 10
        }
      },
      "id": "Maya",
      "name": "Maya",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        860,
        300
      ]
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.sessionId }}",
        "contextWindowLength": 15
      },
      "id": "Memory",
      "name": "Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        860,
        520
      ]
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.0-flash",
        "options": {
          "temperature": 0.7
        }
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "id": "Gemini",
      "name": "Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        760,
        520
      ]
    },
    {
      "parameters": {
        "name": "tool_availability",
        "description": "Busca horarios disponiveis no Synka para uma data e profissional. Parametros: {date} (YYYY-MM-DD) e {profissionalId}.",
        "url": "https://somar-clinicas-consutorios.vercel.app/api/bot/availability?date={date}&profissionalId={profissionalId}&tenantId={{ $json.tenantId }}",
        "method": "GET",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "date",
              "description": "Data desejada no formato YYYY-MM-DD. Ex: 2026-03-24",
              "type": "string"
            },
            {
              "name": "profissionalId",
              "description": "ID do profissional",
              "type": "string"
            }
          ]
        }
      },
      "id": "tool_availability",
      "name": "tool_availability",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1,
      "position": [
        960,
        520
      ]
    },
    {
      "parameters": {
        "name": "consultar_agendamentos",
        "description": "Lista agendamentos futuros do paciente no Synka. Parametro {phone} com apenas digitos do telefone.",
        "url": "https://somar-clinicas-consutorios.vercel.app/api/bot/appointments?phone={phone}&tenantId={{ $json.tenantId }}",
        "method": "GET",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "phone",
              "description": "Numero de telefone do paciente apenas com digitos. Ex: 5585999999999",
              "type": "string"
            }
          ]
        }
      },
      "id": "tool_list",
      "name": "tool_list",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1,
      "position": [
        1080,
        520
      ]
    },
    {
      "parameters": {
        "name": "tool_book",
        "description": "Cria um novo agendamento no Synka. Parametros: {nome}, {dataHora} (ISO 8601), {profissionalId} e {servicoId}.",
        "method": "POST",
        "url": "https://somar-clinicas-consutorios.vercel.app/api/bot/appointments?nome={nome}&dataHora={dataHora}&profissionalId={profissionalId}&servicoId={servicoId}&pacienteTelefone={{ $json.sessionId }}&tenantId={{ $json.tenantId }}",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "nome",
              "description": "Nome completo do paciente",
              "type": "string"
            },
            {
              "name": "dataHora",
              "description": "Data e hora do agendamento no formato ISO 8601. Ex: 2026-03-24T15:00:00",
              "type": "string"
            },
            {
              "name": "profissionalId",
              "description": "ID do profissional selecionado",
              "type": "string"
            },
            {
              "name": "servicoId",
              "description": "ID do servi\u00e7o selecionado",
              "type": "string"
            }
          ]
        }
      },
      "id": "tool_book",
      "name": "tool_book",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1,
      "position": [
        1200,
        520
      ]
    },
    {
      "parameters": {
        "name": "cancelar_remarcar",
        "description": "Cancela ou remarca um agendamento no Synka. Parametros: {id} ID do agendamento, {status} cancelado ou remarcado. Para remarcar inclua {dataHora} no formato ISO 8601.",
        "method": "PUT",
        "url": "https://somar-clinicas-consutorios.vercel.app/api/bot/appointments/{id}?status={status}&dataHora={dataHora}&tenantId={{ $json.tenantId }}",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "id",
              "description": "ID do agendamento",
              "type": "string"
            },
            {
              "name": "status",
              "description": "Novo status: cancelado ou remarcado",
              "type": "string"
            },
            {
              "name": "dataHora",
              "description": "Nova data/hora se for remarcar (ISO 8601). Deixar vazio se for cancelar.",
              "type": "string"
            }
          ]
        }
      },
      "id": "tool_cancel",
      "name": "tool_cancel",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1,
      "position": [
        1320,
        520
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.ultramsg.com/{{ $node[\"PrepareData\"].json.instanceId }}/messages/chat",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "token",
              "value": "={{ $node[\"PrepareData\"].json.ultraMsgToken }}"
            },
            {
              "name": "to",
              "value": "={{ $node[\"PrepareData\"].json.from }}"
            },
            {
              "name": "body",
              "value": "={{ $json.output }}"
            }
          ]
        },
        "options": {}
      },
      "id": "UltraMsg",
      "name": "UltraMsg",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        1100,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Identificar Empresa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identificar Empresa": {
      "main": [
        [
          {
            "node": "PrepareData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PrepareData": {
      "main": [
        [
          {
            "node": "Maya",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Maya": {
      "main": [
        [
          {
            "node": "UltraMsg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "Maya",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "Maya",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "tool_availability": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool_list": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool_book": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool_cancel": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool_metadata": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool_professionals_by_service": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "tool_client_info": {
      "ai_tool": [
        [
          {
            "node": "Maya",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}

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

Synka SaaS - Master Workflow (COMPLETO). Uses httpRequest, agent, memoryBufferWindow, lmChatGoogleGemini. Webhook trigger; 11 nodes.

Source: https://github.com/graphwell/synka/blob/fa9ef705b296a7543b69196a5a5abf2334d6306a/n8n/workflow.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

veo limpo new. Uses moveBinaryData, httpRequest, chatTrigger, baserow. Webhook trigger; 36 nodes.

Move Binary Data, HTTP Request, Chat Trigger +8
AI & RAG

Somar.IA SaaS - Agente Autônomo WhatsApp (Dinâmico). Uses httpRequest, agent, lmChatGoogleGemini, memoryBufferWindow. Webhook trigger; 22 nodes.

HTTP Request, Agent, Google Gemini Chat +2
AI & RAG

N8N Workflow. Uses httpRequest, toolHttpRequest, memoryBufferWindow, lmChatGoogleGemini. Webhook trigger; 13 nodes.

HTTP Request, Tool Http Request, Memory Buffer Window +2
AI & RAG

Somar.IA SaaS - Agente Autônomo WhatsApp (Gemini). Uses agent, lmChatGoogleGemini, memoryBufferWindow, toolHttpRequest. Webhook trigger; 7 nodes.

Agent, Google Gemini Chat, Memory Buffer Window +2
AI & RAG

L&D_AgentsAI_ATIVO. Uses httpRequest, agent, googleCalendarTool, toolSerpApi. Webhook trigger; 93 nodes.

HTTP Request, Agent, Google Calendar Tool +9