service flow

Hello, I need technical help reviewing a workflow in n8n.

I am building a WhatsApp customer registration/update workflow using n8n + Google Sheets + Z-API.

The workflow starts in WF001 and then continues in WF002.

The important design decision is that I DO NOT want to use an “ETAPA” column in Google Sheets.

Instead, WF002 should identify where the customer is in the conversation by analyzing the existing data in the Google Sheets row.

The conversation has these steps:

  1. Customer accepts the registration/update
  2. Customer provides their shoe size
  3. Customer answers M04, which is the preferred product category
  4. Customer answers M05, which is another question in the flow
  5. The workflow processes the final response and sends the remaining messages

In WF002, there is a Switch/Rules node called:

“Identificar momento da conversa”

It currently has rules that try to identify:

NUMERACAO
M04
M05
INTERESSE
RESPOSTA_M05

The rules use the existing fields in Google Sheets, such as:

  • Numeração
  • Categoria Preferida
  • Última resposta
  • other existing customer data

We previously tried several modifications to this workflow, but the tests did not work reliably.

Before making any more changes, I want to understand the correct n8n architecture.

My questions are:

  1. Is it correct to use a Rules/Switch node to determine the current conversation step based on existing Google Sheets fields, without creating an ETAPA column?

  2. Can a workflow reliably identify whether the incoming WhatsApp message is the customer’s answer to question 1, question 2, question 3, etc., using only the existing Google Sheets data?

  3. Are there any problems with using expressions that reference another node, such as:
    $(‘Preparar Resposta Recebida’).item.json
    inside Switch/Rules conditions?

  4. We currently have several Wait nodes:

    • 10 seconds
    • 60 seconds after M04
    • 60 seconds after M05
    • 5 seconds between M06 and M07
    • 5 seconds between M07 and M08

Some of these Wait nodes are intended only to create a delay between messages, while the 60-second Wait nodes are intended to give the customer time to send another response before the workflow searches for it.

Could these Wait nodes cause problems with webhook executions, concurrent executions, or the workflow losing/mixing customer context?

  1. What would be the recommended n8n architecture for this type of WhatsApp conversation, where each customer can respond at different times and every new WhatsApp message starts a new webhook execution?

  2. Is there a better way to identify the conversation state without using an ETAPA column?

I can provide screenshots of the workflow and the configuration of the Rules, Wait nodes, Google Sheets nodes and Z-API HTTP Request nodes.

I would like to understand the correct architecture before changing the workflow again, because we have already made several changes without getting reliable results.

A Switch on existing sheet fields can work, but only if those fields are a real state machine: empty vs filled, in a fixed order. If shoe size, M04, and M05 can be blank for different reasons, the Switch will guess the wrong step.

The bigger break is the Wait nodes plus a new webhook execution on every WhatsApp message. The 60-second Wait is not waiting for the customer. It is holding one execution open while the next inbound message starts a second execution against the same sheet row. That is how customer context gets mixed.

I would treat every inbound webhook as a new run: look up the row by phone, decide the step from which required fields are still empty (first blank in a fixed order: accepted, Numeração, Categoria Preferida, M05), write the new answer, send the next question, end the execution. No Wait for a reply. Use Wait only as a short delay between two outbound messages in the same run.

$(‘Preparar Resposta Recebida’).item.json inside Switch is fragile when more than one execution is in flight. Prefer $(‘Preparar Resposta Recebida’).first().json or, safer, write the inbound text onto the item before the Switch so the Switch reads $json.

What would settle it: one sheet row for one test phone, three inbound messages sent a minute apart, and a screenshot of the row after each message. If the fields fill in order and no second customer is touched, the architecture is right. If two runs write the same row at once, the Wait/webhook overlap is the failure.

Hey @Sueli

Your architecture instinct is right — deriving state from existing Google Sheets fields is cleaner than an ETAPA column, but the Switch node + Wait node combo is where reliability breaks down under real WA traffic.

Redesign WF002 to derive conversation state from field-presence logic (Numeração empty = step 1, filled but Categoria empty = step 2, etc.) — deterministic, no cross-node references

Replace Wait nodes with webhook-driven re-entry so every WA message starts fresh and reads current sheet state

Eliminate $('NodeName').item.json inside Switch rules — this breaks on re-executions

Add an idempotency key per phone number to handle concurrent messages safely

Full architecture doc + working WF001/WF002 rebuild with test cases