ChatHub/docs

Search documentation

SUGGESTED FOR YOU200 results

Search published articles · By section

How to use Workflows

Build and connect a workflow, understand the purpose and use of all 50 node types, test it and choose how it starts, with real screenshots.

What is a Workflow?#

Workflows at /scenarios build multi-step conversations: greet a customer, wait for a reply, follow a matching branch, then reply or hand over to a person. This guide uses the Customer support menu template, which does not require AI configuration.

The demonstration system now contains [MẪU] Menu hỗ trợ shop with seven steps, saved and disabled. Open it to follow along, or create your own copy using the instructions below.

Vietnamese interface. The Steps tab shows the start, menu and reply branches. The header confirms Saved, Disabled and seven steps.

1. Create a workflow from a template#

  1. 1

    Open Automation → Workflow, or /scenarios on your ChatHub domain, with an account that can access this feature.

  2. 2

    Click Create from template (Tạo từ mẫu). Find Menu hỗ trợ khách hàng under Support and select the seven-step template.

  3. 3

    Enter [MẪU] Menu hỗ trợ shop and click Create workflow (Tạo workflow). Templates start disabled so you can customize them first.

Vietnamese interface. Select the support menu on the left, enter a name on the right, then click Create workflow at the bottom.

2. Understand the sample flow#

  1. 1

    Start → Choice: send a greeting and wait for one of three options.

  2. 2

    Xem bảng giá → Send price list → return to the menu. Prices come from your shop product data, not a fixed list in this guide.

  3. 3

    Hướng dẫn mua hàng → send purchase instructions → return to the menu.

  4. 4

    Gặp nhân viên → send a handover message → hand over to a person.

  5. 5

    Any other reply → ask the customer to choose a menu option → return to the menu.

Use Các bước (Steps) to read and edit in order. Sơ đồ (Diagram) shows connections; use Fit to view the flow. Click a step to edit its configuration.

4. Write a reply and return to the menu#

Open the Send message step under Hướng dẫn mua hàng. The saved sample tells the customer to select a product, note its name and contact staff to confirm availability and payment. It explicitly says the menu does not create orders or collect payment.

Vietnamese interface. Enter the purchase instructions in the message content. This sample text should be adapted to your shop process.
  1. 1

    Scroll to Next step and select 2. Cho khách chọn, so the menu appears again after the reply.

  2. 2

    Check the return connections for the price list and fallback too. Hand over to a person ends the staff branch.

  3. 3

    Click Save at the top right. Wait for Saved before opening the test chat.

Vietnamese interface. The target points back to menu step 2. Insert a step between them if another action is needed before returning.

5. Add steps when extending the flow#

  1. 1

    In Steps, click + after the step you want to extend; choose the intended branch for a branching step.

  2. 2

    Search in Add step. Send message continues after sending; Ask customer waits for a reply; Choice offers predefined options.

  3. 3

    Configure the new step, check its next target and save. Use Insert variable in content fields to select context data instead of guessing variable names.

Vietnamese interface. The Add step picker groups actions and explains each type. Only the picker was opened here; the saved sample still has seven steps.

5a. Create, drag and connect nodes on the canvas#

Each card in Sơ đồ (Diagram/canvas) is a node, or workflow step. Add a node, drag its card into a readable position, then drag an output dot onto a target step. The current interface creates nodes with + or Thêm bước (Add step). Dropping a connection dot on empty canvas does not create a node; the existing connection stays unchanged.

  1. 1

    Open Sơ đồ. Use Thu vừa khung (Fit) in the bottom-right toolbar if steps are out of view. Click the background and use the mouse wheel to zoom; drag empty background to pan.

  2. 2

    Find the step you want to extend and click + inside its card. For example, use + under the Send message step on the Hướng dẫn mua hàng branch.

  3. 3

    In Thêm bước, search for Gửi tin nhắn (Send message), then click the result card. The new node is inserted after the selected step and before its previous target.

Vietnamese interface. The search field at the top contains Gửi tin nhắn. Click the result on the right to add a node after the step whose + button you clicked. This demonstration draft has not been saved.
  1. 1

    Enter the new node’s Content, for example: Tin nhắn minh họa kéo thả, chưa lưu. This means an unsaved drag-and-drop demonstration message. Close the configuration panel to see the diagram.

  2. 2

    Check the connection from the previous step to the new node and from the new node to the previous target. Here, it sits between the purchase instructions message and the Choice menu.

Vietnamese interface. The right-hand card contains the sample text. The left card’s Bước tiếp theo (Next step) dot connects to the new node. Yellow outlines mark unsaved changes. The new node still connects back to the menu.
  1. 1

    To arrange a node, hold its title bar, drag to the desired position and release. Avoid the + button and connection dots when moving a card. Hold Alt while dragging to move freely without snapping.

  2. 2

    Moving a card changes its layout; connections follow the node. Use Tự dàn lại vị trí các bước (Auto arrange) or Thu vừa khung (Fit) if the diagram becomes hard to read.

Vietnamese interface. Captured after dragging the Gửi tin nhắn title bar to the upper right, before adding the sample node. The Hướng dẫn mua hàng branch still reaches this card, and Next step still returns to the menu. This layout change is unsaved.
  1. 1

    To change a target, hold the round dot to the right of Bước tiếp theo (Next step), drag onto the target card and release over that card. For Choice, use the dot next to the specific option, such as Hướng dẫn mua hàng.

  2. 2

    Practice example: drag the new message node’s Next step dot onto Gửi bảng giá (Send price list). The arrow should now enter that card. This changes execution flow; drag the dot back onto Cho khách chọn (Choice) if you want to return to the menu.

  3. 3

    Click the source node and verify Đi tới bước (Go to step) in its configuration. For branching nodes, check the target of the intended branch. Placing two cards next to each other does not connect them.

Vietnamese interface. The round dot is on the right edge of the sample node. Dropping it onto Gửi bảng giá on the left redirects the connection to that card. This is an unsaved target-change example, separate from the saved seven-step flow.
The drag-and-drop screenshots use a draft whose changes were discarded. The saved sample remains disabled with seven steps. For your own workflow, verify content and connections, click Save and wait for Saved before testing. If running sessions block saving, inspect and handle them according to actual needs; do not end customer sessions just to practice.

6. Picking a node and the Start node#

Click the + after a step, then filter by category or search by purpose. The picker shows 49 nodes that can be added; with the automatically created Start node, a workflow has 50 node types.

Vietnamese interface. The left column counts 49 addable nodes: 6 conversation, 21 commerce, 7 flow, 10 customer-management and 5 integration nodes. Start already exists in the workflow, so it is not in the picker.
  1. 1

    Start — Purpose: the workflow's single entry point. How to use: keep exactly one Start node and connect it to the first step the customer should receive; it has no content field and cannot be added again.

  2. 2

    Pick the insertion point — A + after a node inserts the new step before its old destination; a branching node asks which branch receives the step. Recheck the connection on the Canvas.

  3. 3

    Configure the next paths — Open the new node, complete required fields, select the next step and add failure or no-reply paths when the node supports them.

  4. 4

    Save and test — Test only after the header says Saved. Commerce, payment, email, API and appointment nodes may create real data, so use safe test records.

The names and counts in the screenshot were verified directly at /scenarios. If a later ChatHub release adds a node, search the Add step picker and read the card description before configuring it.

7. Customer interaction (6 nodes)#

These nodes produce bot messages, questions and intent branches. Choose one according to whether the bot should continue immediately, wait for the customer, or ask AI to interpret the request.

Vietnamese interface. Select Customer interaction in the left column to see all six nodes. Clicking a card inserts it after the chosen position but does not save the workflow yet.
  1. 1

    Send a message — Purpose: sends text and immediately continues. How to use: enter the content, insert variables if needed and select the next step; adding buttons makes the node wait for a customer click.

  2. 2

    Ask the customer — Purpose: asks a free-text question and waits. How to use: write the question, create matching branches plus a fallback and a no-reply path; later nodes can use the latest answer.

  3. 3

    Offer a choice — Purpose: presents a fixed list. How to use: add the prompt and choices, select matching mode, connect every choice and keep an Other answers branch; optional commands can return to the menu.

  4. 4

    Reply with AI Agent — Purpose: writes a reply from instructions, recent messages and allowed shop data. How to use: configure an AI provider, constrain the prompt and data sources, connect the next step and test unexpected questions.

  5. 5

    Let AI sort the request — Purpose: classifies the customer's meaning into named branches. How to use: define distinct categories such as Warranty, Sales and Complaint, describe them and connect every category plus a failure path.

  6. 6

    Send a quick reply — Purpose: sends a saved quick reply with its attachments. How to use: create the quick reply first, select it in the node and connect the next step; later edits to the saved reply update future bot messages.

8. Commerce: products and orders (7 nodes)#

The first seven Commerce nodes present products, sell them and let customers look up their own orders.

Vietnamese interface. This is the top of the 21-node category; scroll the right pane for subscription, appointment, balance and payment nodes.
  1. 1

    Send the price list — Purpose: sends active products with current prices. How to use: add an introduction, optionally filter a category and connect the next step; update Products instead of typing fixed prices into the message.

  2. 2

    Let the customer pick a product — Purpose: sends the list and waits for a number, code or name. How to use: set the introduction/filter, then connect to Sell a product or a confirmation step because the choice is retained.

  3. 3

    Sell a product — Purpose: checks stock, charges the wallet, delivers the item and records an order. How to use: select a fixed or previously chosen product, configure quantity/questions and connect a failure path for insufficient stock or balance.

  4. 4

    My orders — Purpose: lists recent orders for the current customer. How to use: set the introduction, status filters and limit, then continue or connect to Show one order in full.

  5. 5

    Show one order in full — Purpose: asks the customer to select an order and returns its status, answers and delivered content. How to use: place it after My orders or configure a suitable filter; the selected order can feed cancel/note nodes.

  6. 6

    Customer cancels an order — Purpose: cancels the selected eligible order, releases stock and refunds wallet charges. How to use: place it after an order-selection node, write success/failure messages and connect the failure branch.

  7. 7

    Note on the order — Purpose: adds an order note for fulfilment staff. How to use: place it after an order is created or selected and compose the note with variables; it does not change order status.

9. Commerce: subscriptions and appointments (8 nodes)#

The middle of the category forms two clear chains: choose a plan → buy/check it, and list appointments → choose a time → book/move/cancel.

Vietnamese interface. The middle view contains three subscription nodes and five appointment nodes; the scrollbar shows it is one portion of the 21-node category.
  1. 1

    Let the customer pick a plan — Purpose: shows plans with price, duration and uses, then waits. How to use: define each plan in the node with a stable code and connect it to Sell a subscription plan.

  2. 2

    Sell a subscription plan — Purpose: charges the wallet and activates or extends the selected plan. How to use: follow the plan picker or choose a fixed code, connect the failure path and confirm the new expiry/uses.

  3. 3

    Check the subscription — Purpose: allows only an active plan with remaining uses and deducts the configured usage. How to use: put it before the protected service and send failures to a purchase/renewal path.

  4. 4

    Let the customer pick a time — Purpose: reads business hours, service duration and existing bookings to show free slots. How to use: choose the service/date range, write the prompt, connect to Book the appointment and handle no-slot failures.

  5. 5

    Book the appointment — Purpose: creates the booking for the selected slot and links an order when present. How to use: place it immediately after slot selection, add confirmation text and connect the race-condition failure path.

  6. 6

    List the customer's appointments — Purpose: lists upcoming bookings and waits for a choice. How to use: place it before reschedule/cancel; branch on appointments.count when the list is empty.

  7. 7

    Move the appointment — Purpose: moves the selected appointment to the selected new slot. How to use: chain List appointments → Pick a time → Move appointment and handle a newly occupied slot.

  8. 8

    Cancel the appointment — Purpose: cancels the selected booking, reopens the slot, disables reminders and refunds/cancels a paid order. How to use: place it after appointment selection and add a confirmation step before cancellation.

10. Commerce: balance and payments (6 nodes)#

The last Commerce nodes change the wallet or wait for a payment provider. Test them cautiously because they can change a real balance.

Vietnamese interface. The bottom of the 21-node category shows balance and payment actions. The screenshot only opens the picker; no transaction or wallet change was run.
  1. 1

    Take from the customer balance — Purpose: charges an amount from the wallet. How to use: enter an amount or variable and connect When this step fails for insufficient funds; without that branch the workflow stops.

  2. 2

    Add to the customer balance — Purpose: tops up, gifts or refunds an amount. How to use: run it only after a verified condition and record/notify the reason for reconciliation.

  3. 3

    Tell the customer their balance — Purpose: reads and sends the latest balance without changing it. How to use: add explanatory text and place it after a credit/debit or in a self-service menu.

  4. 4

    Top up via Pay2S — Purpose: sends bank instructions and a reference, waits for Pay2S and credits the wallet. How to use: configure Pay2S first, write the instructions and connect the failure path; never fake a paid result.

  5. 5

    Top up via Binance Pay — Purpose: gives the shop Pay ID and a unique fractional amount, then matches the transfer. How to use: configure Binance, always provide the amount, tell the customer to send it exactly and handle timeout/failure.

  6. 6

    Cashback — Purpose: creates cashback links, shows orders/shared balance or records a withdrawal request for admin handling. How to use: pick the required action, configure cashback_api_url and cashback_api_key safely in Variables/environment, then connect each expected result.

Testing payment, sale or appointment nodes may create real records. Use the test customer and small values; do not execute a financial flow merely to produce documentation screenshots.

11. Flow & conditions (7 nodes)#

These nodes mainly control routing: choose a path, remember a value, wait, delegate work or stop.

Vietnamese interface. All seven flow nodes fit in the picker. Start is absent because ChatHub creates exactly one automatically.
  1. 1

    Branch on a condition — Purpose: compares the latest answer or another field and follows True/False. How to use: choose the field, operator and value, then test both routes, especially numeric comparisons.

  2. 2

    Random split — Purpose: randomly sends traffic to named variants. How to use: name/configure the variants, connect every branch and collect enough results before judging a wording experiment.

  3. 3

    Remember a value — Purpose: stores a run-scoped value as {{data.name}}. How to use: choose a name without spaces, enter a value or leave it blank for the latest answer, then insert the variable later.

  4. 4

    Wait a moment — Purpose: pauses for a number of seconds. How to use: enter a sensible delay between messages; use Background job for long or independent monitoring.

  5. 5

    Run another workflow — Purpose: hands the full context to the target workflow and ends the current one. How to use: select a tested target, avoid circular calls and place it at the end of the hand-off branch.

  6. 6

    Background job — Purpose: creates, lists or stops an independent branch while the conversation continues. How to use: pick the action, label/limit it and build the background path for waits, API calls and later messages.

  7. 7

    End — Purpose: stops the workflow and returns the conversation to normal. How to use: place it at the end of a completed branch; it has no next step.

12. Customer management (10 nodes)#

These nodes update the record and queue or route a conversation to the right people without another customer action.

Vietnamese interface. All ten customer-management nodes fit in one view; only the picker is open on a disabled sample workflow.
  1. 1

    Add a tag — Purpose: labels the conversation/contact for filters and reports. How to use: create the tag first, select it and continue; use stable names such as VIP or Call back.

  2. 2

    Change the status — Purpose: sets Open, Pending, Resolved or Closed. How to use: choose the status that matches this point; Resolved commonly belongs at the end of a completed branch.

  3. 3

    Change the priority — Purpose: sets Low, Normal, High or Urgent for queue ordering. How to use: raise it only under a clear condition, then alert or assign staff.

  4. 4

    Write an internal note — Purpose: adds staff-only context. How to use: insert relevant answers/variables, avoid unnecessary secrets and place it before hand-off.

  5. 5

    Save to the customer record — Purpose: stores the latest answer in a contact field. How to use: ask first, select the correct standard/custom field and validate phone/email formats when reused.

  6. 6

    Assign to an agent — Purpose: assigns a named person and hands the conversation to a human. How to use: select an available agent and tell the customer before assignment.

  7. 7

    Assign to a team — Purpose: makes the conversation visible to a team. How to use: select Sales/Support and optionally set priority or add a note first.

  8. 8

    Assign to whoever is on shift — Purpose: routes by schedules and distribution settings. How to use: configure shifts first and connect the failure path for times when nobody can receive it.

  9. 9

    Alert a member of staff — Purpose: sends a bell notification while the bot continues. How to use: enter title/body, select a person/team or leave blank for the assignee, then connect the next step.

  10. 10

    Hand over to a person — Purpose: stops the bot and returns the conversation to staff, with no next step. How to use: place it at the end of a manual-intervention branch and notify the customer immediately before it.

13. System integration (5 nodes)#

Integration nodes move data through email, web pages and APIs. Use trusted addresses and never hardcode API keys or passwords in workflow content.

Vietnamese interface. All five integration nodes fit in the picker. Opening the list does not send email, call an API or fetch any page.
  1. 1

    Send email — Purpose: sends mail through configured SMTP. How to use: configure SMTP, enter recipient/subject/body and insert variables; testing can send real mail, so use an approved test address.

  2. 2

    Translate — Purpose: translates the latest answer or composed text into {{translation.text}} without sending it. How to use: select the target/source and follow it with Send a message using the result variable.

  3. 3

    Read a web page — Purpose: extracts title, description, image, price, stock and readable text into variables. How to use: provide a fixed URL or the customer's last answer and treat fetched text as untrusted data, never as AI system instructions.

  4. 4

    Call an API — Purpose: sends a configured method/headers/body and retains status/body for later nodes. How to use: use HTTPS, variables and explicit error handling; test with samples and keep secrets out of code/screenshots.

  5. 5

    Call another system — Purpose: sends conversation data to an HTTP(S) webhook and waits up to ten seconds. How to use: provide a secured receiver and connect the next step; choose Call an API when request/response control is needed.

Quick distinction: Call another system is for event webhooks; Call an API is for querying/writing data and reusing the response; Read a web page is for HTML page content.

14. Test the conversation#

Chat thử với bot uses the real engine and the saved workflow, with a test customer, wallet and an actual inbox conversation. Purchase or payment steps can deduct funds, remove stock and create real orders. This guide tested only the instructions and fallback branches, not purchasing, payments, prices or staff handover.
  1. 1

    After saving, click the Chat thử với bot icon in the top toolbar. Wait for the greeting and three options.

  2. 2

    Click Hướng dẫn mua hàng. The expected result is the saved instructions followed by the menu again, with a waiting-for-reply status.

Vietnamese interface. Verified with the test customer: the instructions option returns its message and then shows the three choices again.
  1. 1

    Enter abc thử nhánh khác in the reply field and click Reply.

  2. 2

    Expected result: the bot asks the customer to choose an option, then shows the menu again. Use Restart from beginning when you need a fresh run.

Vietnamese interface. An unmatched answer reaches the fallback. The screenshot shows the reminder, menu and input for further testing.

15. Choose how to start and troubleshoot#

  1. 1

    Open Workflow settings using the sliders icon beside Save.

  2. 2

    Auto greet new customers starts the workflow for every new conversation when enabled. For conditional starts, leave it off and use the Run workflow action in an Automation rule.

  3. 3

    Enable the active status only after customizing the content and checking the relevant branches, then save. This guide leaves the sample disabled with automatic greeting off.

Vietnamese interface. Both switches are off: the sample is saved but does not automatically run for new customers.
  1. 1

    Old reply text: check for unsaved changes, save and restart the test.

  2. 2

    Wrong branch: check option labels, matching mode and target steps; keep a fallback for unmatched input.

  3. 3

    Menu does not return: check that the reply targets step 2.

  4. 4

    Does not run outside the test chat: check workflow status, its start mechanism and the calling rule conditions.

  5. 5

    Empty or unexpected prices: inspect your shop products. The introductory message is not the price-list data.

Read the Automations guide to configure a rule that starts a workflow ↗

How to use WorkflowsBack to top
© 2026 ChatHub DocsPowered by CMSNT LTDA guide to using ChatHub.