Skip to main content

How to build your first Flow step by step

A worked example of automatic refunds for cheap returns: from the brief in the AI Flow Editor through checking the graph to activation and runs.

Written by Milan Smolík

We will walk through building a Flow on one concrete example: from the brief in the AI editor to activation. Any other Flow is built the same way, you just write a different brief.

The example is handling cheap returns automatically. Flow settles returns up to 2,500 CZK on its own: it waits for the goods to arrive back at the warehouse, refunds the money, sends the customer a confirmation and closes the ticket. More expensive returns go to an agent for review.

Note: Flow is part of the Advanced and Enterprise plans, and available on request on Standard. For how Flow works in general, see How Flow works.

What the Flow does

  • It starts when a customer creates a return.

  • It loads the products on the ticket and their value.

  • Up to 2,500 CZK: it waits for the shipment to arrive back at the warehouse, creates a refund, switches the state to Refunded, sends a confirmation email and closes the ticket.

  • Over 2,500 CZK: it assigns the ticket to an agent and stops there.

Steps

  1. Open Settings → Workflows → Flow and click Create Flow.

    The flow list with the Create Flow button
    A new flow: New Flow, Inactive, the ticket.created trigger and no nodes

  2. Type the brief into the AI editor. Your own words are fine; the concrete values are what matters:

    Example brief:

    When a customer creates a return up to 2,500 CZK, wait until the shipment is back at the warehouse. Then create a refund for the full amount, switch the ticket to Refunded, send the customer a confirmation email and close the ticket. If the return is more expensive, just assign it to an agent.

    The brief typed into the AI Flow Editor

  3. The editor asks for anything missing, such as which agent should get the expensive returns. Answer and let it assemble the Flow.

  4. Review the graph in the Flow tab. Check the condition and both branches above all: what happens below the limit and what above it.

  5. Anything else you fine-tune with another message, for example “add a manual review tag to returns over 2,500 CZK”.

  6. Finally click Activate. While the Flow is Inactive, it will not run.

    The header of an active flow with the Deactivate button

The finished Flow should look like this:

The graph of the finished flow with the condition and both branches

How you know it works

After the first return, a record appears in Settings → Workflows → Runs. Its detail shows the steps that ran, their order and the data the Flow worked with.

The run stays in the Waiting state for as long as the Flow waits for the returned shipment. That is fine. It continues on its own once the shipment arrives.

What to watch out for

Warning: Waiting for a shipment has no limit. If the customer never sends the goods, the run stays in the Waiting state forever. Keep that in mind when going through the list of runs.

An edit to a Flow applies immediately to new runs. The ones already running finish in the shape they started with, so after changing the limit some returns may still follow the old rule for a while.

The refund is created for the full value of the return. If you want to deduct postage or refund only a part, say so in the brief.

Did this answer your question?