Skip to content

Automation

Automation is a module that comes with every workspace. Each automation is a flow: it makes Valinor act on its own when something happens, such as tagging, creating a task or sending a message. In the menu, flows are under Automação → Flows.

What changes from one workspace to another is what flows offer: every module that is turned on adds its own triggers, conditions and actions.

Every flow has three parts:

  1. When — the event that triggers it. Some ask for a number, such as the days in “Dias antes do check-in” (days before check-in).
  2. Conditions — optional filters, such as the deal stage, the contact segment or the invoice amount. Numbers can be compared with “é maior que” (greater than) and “é menor que” (less than).
  3. Actions — what Valinor does when the event happens and the conditions match.

On a computer, flows are built in a visual editor; on a phone, they open read-only, with the execution history. The flow list shows what each one acts on, its conditions and its actions, and lets you change the order in which they run.

With the AI module on, the Criar com IA (create with AI) button, on the flow list, builds the flow from a description: “when the deal enters Proposal, wait 2 days and create a follow-up task”. The AI uses only what the modules turned on offer and the names in your workspace (stages, labels, templates, teams), and the draft opens in the editor with a sentence about each step. Nothing is saved until you review and save it, and the flow starts turned off: turning it on is your call. When the request needs something flows can’t do yet (sending an SMS, for example), the AI says what is missing instead of inventing a step. Each draft spends AI credits and shows up in the statement as Gerar flow com IA. The button shows for whoever can edit flows, on a computer. On the deal board, Descrever flow (describe a flow), in the column’s flows button, does the same already in that column’s stage: if the description doesn’t say when the flow runs, it runs when the deal enters that stage.

In the editor, the Ajustar com IA (adjust with AI) field changes the flow on the screen by asking: “now wait 2 days before the task”, “only if the value is over 5 thousand”. The AI returns the whole adjusted flow, says what changed and explains each step again; Desfazer ajuste (undo adjustment) goes back to the flow before it. It works on the draft and on saved flows, and nothing is saved until you save. Each adjustment shows up in the statement as Ajustar flow com IA.

Whoever inherits a flow can ask for Explicar (explain), at the top of the editor: using your workspace’s names (pipelines, stages, templates, members), the AI says when the flow runs and what it does, and writes a sentence under each step in the list. The explanation doesn’t change the flow and shows up in the statement as Explicar flow com IA.

The Testar (test) button, at the top of the editor, runs the flow as it is on the screen — saved or not — with a real record you choose: a contact, a deal, a reservation. Nothing is saved or sent. Each action says what it would do (“Criaria a tarefa…”, it would create the task “Call Ana Souza” for Marina Reis, due 10/01), and the ones that send a message show the text as the customer would read it. Waits are skipped, showing when the flow would really resume; the path the test took is marked on the canvas. Whatever would fail in a real run — a customer without an e-mail, a reservation that can’t be confirmed — shows up in the test with the same reason. The test never enters the execution history, and AI steps and HTTP requests are not called.

Besides conditions and actions, a flow can:

  • Search records (“Buscar registros”) — deals, contacts, tasks, reservations or invoices of the workspace, with filters such as stage, status, owner, “unchanged for N days”, check-in N days from now or only overdue invoices, and a limit of up to 100. The texts of the next actions can use what the search found: how many, the total and the names.
  • For each (“Para cada”) — runs the steps inside it once for each record the search found, with that record as the subject: “for each stalled deal, tag it and create a task”. After all of them, the flow goes on.

A loop goes through up to 100 records per run. When the search or the loop leaves records out, the history says so.

Every workspace has contact, deal and task flows:

  • When: when a contact is created, when one of its fields changes (fixed or custom, the one you choose), when it gets a tag and on its birthday; when a deal is created, changes stage, is won or is lost; when a task is created, assigned or completed, and days overdue for a task.
  • Stage and pipeline: when a deal enters a stage, leaves a stage or moves to another pipeline, picked from the list. The flow keeps the stage itself, not its name: renaming the stage breaks nothing. A deal created straight into a stage also counts as entering it. And days stuck in the stage, which fires once when the deal reaches the chosen number of days in its current stage.
  • On the pipeline column: each stage of the deal board shows how many flows run in it and opens the list; Novo flow neste estágio (new flow in this stage) opens the editor with “enters a stage” already pointing at the stage.
  • Deal sequence: an “enters a stage” flow with waits is that deal’s sequence — “entered web check-in: send the link; wait a day; remind”. Each deal has its own: a repeated trigger does not start another while the first one waits, and two deals of the same contact run apart. With Parar quando o negócio sair do estágio (stop when the deal leaves the stage, on by default), moving to another stage or pipeline, winning or losing ends that deal’s waits, and the history shows why; coming back to the stage starts a new sequence.
  • Deal conditions: pipeline, stage, status, priority, tags, value, owner and products.
  • Actions: add a tag to the contact or the deal, and create a task — with an owner, and on the deal when the flow runs on a deal or on one of its tasks.
  • Contact and task actions: update a contact field (name, email, phone, city, state or a custom one, with flow data), remove a tag; complete, reschedule and reassign the task. Each one saves through the CRM, like the screen, and the next flows run.
  • Deal actions: create a deal for the contact (from a conversation, a contact, a reservation), in the chosen stage, with a name that takes data (Pacote de {{contato.nome}}) and an owner; move to a stage (in the same pipeline or another); set the owner; mark as won or as lost, with the reason. Each one saves right away and fires the flows the deal would fire if someone did the same on screen — “enters a stage”, for example.

Contact actions — create a task, tag the contact and, with Omnichannel, send a WhatsApp template — work in any flow that has a contact behind it: the deal’s customer, the reservation’s guest, the invoice’s customer.

Criar contato (create contact) works in any flow, including the schedule and webhook ones, which have no contact behind them. Name, e-mail and phone take flow data ({{gatilho.nome}}); with no name, the contact takes the e-mail or the phone. If a contact with the same e-mail (case-insensitive) or the same phone already exists, the flow uses it and moves on, with no duplicate. A new contact fires the “contact created” flows. The next steps can run on the created contact. The phone goes with the country code (5511987654321).

Each action picks which record it runs on: the flow’s subject, a record linked to it — the contact, the contact’s open deal, the task’s deal — or the record a previous step created, such as the task from “Criar tarefa” (create task). If that record doesn’t exist in that run (the contact has no open deal, for example), the step fails and the history says why.

In Criar tarefa (create task) and Notificar a equipe (notify the team), the member can be Responsável do registro (the record’s assignee): the task and the notice go to whoever is assigned to the deal, task or conversation the step runs on, whoever that is in that run. If the record has no assignee, the task is created without one and the notice goes only to the chosen team — with no team, the step fails saying the record has no assignee.

Notify the team, send e-mail and call another system

Section titled “Notify the team, send e-mail and call another system”

Three actions work in any flow:

  • Notificar a equipe (notify the team) — a member, a team or both get a notice with a title and a text (which take flow data) in the bell and, if the member allows it, as a push. Each member decides under Notificações whether they want flow notices. Someone in the team who was also picked gets it once.
  • Enviar e-mail (send e-mail, with Marketing) — a template from the marketing e-mail editor to the flow’s contact (the contact itself, the deal’s customer, the reservation’s guest). It goes out through the verified domain, with the unsubscribe link and counting toward the monthly quota. It never goes to someone who left marketing e-mails or to a suppressed address: the step fails saying why.
  • Chamar webhook (call a webhook) — a POST to another system with a JSON of the flow, the record (with the same data as the texts, such as sujeito.dados.contato.nome), the trigger data and the steps’ output. The answer becomes {{passos.<id>.resposta}} for the next steps; an error code fails the step. Valinor does not call internal network addresses nor follow redirects.

Every webhook call carries the headers X-Valinor-Timestamp and X-Valinor-Signature: sha256=<hex>, the HMAC-SHA256 of timestamp.body made with the workspace signing key. The key shows up in the step, to copy; Gerar nova chave (generate a new key) replaces it for every flow. To check it on the other side:

const expected = "sha256=" + crypto.createHmac("sha256", key).update(`${timestamp}.${body}`).digest("hex");

The Requisição HTTP (HTTP request) step queries or notifies another system’s API, in any flow: method (GET, POST, PUT, PATCH or DELETE), address, headers (one per line, such as X-Origem: Valinor) and a JSON body. All of them take flow data; in the body, the data goes in escaped inside the quotes, so {"nome": "{{contato.nome}}"} does not break with a name that has quotes.

The answer goes on to the next steps: {{passos.<id>.codigoHttp}}, {{passos.<id>.resposta}} (the first 4 KB of the text) and, when the answer is a JSON object, one data item per field, such as {{passos.<id>.dados.cliente.id}}. Once the flow has run, the editor offers those fields in the data list. An error code fails the step, and the history shows the code and the beginning of the answer.

Credentials (under Automação › Credenciais, or created right in the step) keep the access to the other system: a Bearer token, an API key in a header (such as X-Api-Key) or a user and password. The secret is stored encrypted and never shows up again, neither on screen nor in the history; to change it, type a new one.

The request waits up to 15 seconds, reads answers of up to 64 KB and follows up to 3 redirects, checking every address: the internal network stays out, as in the webhook. The credential does not follow a redirect to another server.

With the AI module on, four steps understand and write text inside the flow. Every call spends AI credits, which show up in the statement as Passo de flow (flow step); with no credits left, the step fails saying why, without calling the AI or charging anything.

  • Classificar (classify) — reads a text (usually flow data, such as {{gatilho.mensagem}}) and picks one of the categories written in the step, one per line. The chosen one becomes {{passos.<id>.categoria}}, and a condition right after it picks the path.
  • Extrair campos (extract fields) — pulls from the text the fields written in the step, one per line (checkin: the arrival date). Each field becomes {{passos.<id>.dados.<field>}}; whatever the text does not bring stays empty, with no made-up values.
  • Gerar texto (generate text) — writes what the step asks for, with flow data (Write a short answer to {{contato.primeiroNome}}). The text becomes {{passos.<id>.texto}}.
  • Resumir conversa (summarize conversation, in conversation flows) — reads the latest messages, without the team’s notes, and sums up what the customer wants, what was already answered and what is missing, in {{passos.<id>.resumo}}.

The steps take the company’s instructions (“a complaint is when the customer talks about a problem during the stay”) and the AI level: Rápido (fast) spends fewer credits, Avançado (advanced) understands hard texts better. The history shows what the AI answered, but never the model behind the level nor the cost.

The chatbot is a conversation flow with the Quando o chatbot é iniciado (when the chatbot starts) trigger: it talks to the customer through the conversation’s channel, one step at a time. The Chatbot area of the step library holds what it does:

  • Pergunta (question) — sends the question and waits for the answer. The type says what counts as an answer: text, choice, rating, e-mail, phone, number or date. In a choice, up to 3 options become buttons on WhatsApp, and up to 10 become a list; a 1 to 5 rating goes in a list, and the customer types a 0 to 10 one. An answer that does not fit asks the question again, up to the number of attempts.
  • Mandar mensagem (send message) — a text with flow data, or a Drive file with the text as its caption.
  • Transferir para a equipe (hand over to the team) — passes the conversation to a person or a team, and the chatbot leaves.
  • Encerrar o chatbot (end the chatbot) — the chatbot leaves without handing over.

The question has two paths: Com resposta (answered) and Sem resposta (unanswered), which is what happens when the waiting time runs out or the attempts are used up. With a name in Guardar a resposta em (keep the answer in), such as quarto, the answer becomes {{resposta.quarto}} in the texts of the following steps, and Se… senão (if… else) can test it: in a choice, the value is one of the options; in a rating or a number, the condition compares greater and less.

Iniciar chatbot (start chatbot) brings the chatbot to any flow of a record with a contact: contact, deal, task, reservation or invoice — “reservation checked out yesterday → satisfaction chatbot”. The step picks the chatbot and the channel, and opens the contact’s conversation on that channel if there is none yet. Outside WhatsApp’s 24-hour window, it first sends the modelo para abrir a conversa (opening template) and the chatbot starts when the customer replies; with no template, the step fails saying why. A contact without a phone or who asked not to get WhatsApp messages also makes the step fail, with the reason in the history. The conversation keeps where the chatbot came from.

The chatbot’s Respostas (answers) tab shows how many conversations it had in the period and how they ended (completed, handed over, unanswered) and lists one row per conversation: the contact, when it started, the outcome, where it came from (such as “Reserva 123”) and one column per answered variable. The outcome and period filter stays in the page address, and Exportar CSV (export CSV) downloads the same columns of the filter, ready for a spreadsheet. They are just the answers, with no calculation on them: whoever uses them decides what to do with the data. When the conversation with the chatbot ends, it also goes into the contact’s timeline, with the questions and answers.

In Testar (test), the chatbot becomes a conversation: you pick a real conversation and answer in the customer’s place, clicking the buttons or typing, or leave the question unanswered to see the other path. What the chatbot would say shows up as on WhatsApp, and what would happen — saving to a field, handing over, ending — shows up marked as a test; the question waiting for the answer is highlighted on the canvas. Nothing is sent to the customer or saved to the contact.

When someone on the team replies in the conversation or takes it over, the chatbot leaves and the conversation stays with that person. The flow list shows how many conversations each chatbot is in right now, and the Chatbots filter sets the chatbots apart from the other flows.

Not every flow starts from a record. These run on the company and use Buscar registros (find records) and Para cada (for each) to act on whichever deals, contacts or tasks they need, and Criar contato (create contact) to bring in whoever arrived from outside (“website form webhook → create contact → create deal”):

  • Schedule: every day, on chosen weekdays or on a day of the month, at a Brasília time — “every Monday at 8am, for each deal stuck for 7 days, create a task”. Each time runs only once. On the 31st of a shorter month, it runs on the last day.
  • Webhook: another system calls the flow’s URL with a JSON body, and each field becomes trigger data in the steps’ texts ({{gatilho.nome}}). The URL carries a secret: only people who can edit flows see it, and Gerar nova URL (generate a new URL) stops the old one right away. Too many calls in a minute are refused.
  • File sent to the Drive: when someone on the team uploads a file, to the chosen folder or any folder inside it (with no folder, any one counts). The file name, the folder and who sent it become trigger data ({{gatilho.arquivo}}, {{gatilho.pasta}}, {{gatilho.enviadoPor}}).
ModuleAdds
OmnichannelConversation flows (when a conversation is opened or a message arrives; assign, tag, change status) and the send WhatsApp template action. Plus manual flows, the macros: the agent applies them to a conversation from the inbox, and they can reply with a canned response on the agent’s behalf.
HospitalityReservation flows: when it is created, confirmed, checked in, checked out, cancelled or the guest is a no-show; days before check-in and days after check-out. Conditions on status, room category, guests and nights. Actions confirm, cancel and add a note (the text takes flow data and goes below the reservation’s notes).
FinanceInvoice flows: when it is issued, paid, partially paid or cancelled; payment received, on every payment, with the amount and the method ({{gatilho.valorPago}}, {{gatilho.formaDePagamento}}); days overdue. Conditions on status, amount and days overdue. Actions issue invoice (the draft becomes an open invoice, with or without the e-mail to the customer) and send payment reminder (the reminder e-mail, at most one a day per invoice).
MarketingIn contact flows: when the contact unsubscribes (through the e-mail link or by sending “SAIR” on WhatsApp, on the chosen channel or any) and when they click a campaign (the first click in the e-mail, on a chosen campaign or any).

Date triggers run once a day and fire only once for each deal, task, reservation or invoice at that number of days.

A flow that uses a trigger, condition or action from a module that was turned off stops entirely — not even its CRM steps run — and shows up in the list with the notice Requer o módulo … (requires the module). Once the module is back on, it runs again without any edit.

Flows have their own permissions: Ver flows (view), Criar/editar flows (create/edit) and Excluir flows (delete), in the Automação section of the role (see Workspace and team).