quiet robot

Agent Playground

Tutorial 6: Run a flow on its own

Make the website check from Tutorial 1 run every morning by itself, start a flow from another app with a webhook, and start one when code changes on GitHub.

View as Markdown

A flow you have to remember to run is a flow that doesn't get run. In this tutorial you'll add triggers: a schedule that runs your website check every morning, and a webhook that lets another app, like a contact form or Zapier, start a flow. Then you'll see how to start a flow when something happens on GitHub.

Time: about 10 minutes. Plan: Free. You need: the Check my website flow from Tutorial 1. Any saved flow works too.

A triggered run is a normal run: it has the flow's limits and policy, it counts toward your plan's runs, and it shows under Past runs like any other.

1. Run it every morning

  1. Open your Check my website flow.
  2. Choose Triggers in the toolbar. (On a phone or narrow screen, it's under More.) You can also choose the small Triggers tag above the flow's first step.
  3. Under Add a trigger, choose Schedule.
  4. Pick Daily, and a time under At, UTC. Times are in UTC, so for 8:00 in the morning in New York pick 13:00 (12:00 in summer).
  5. Choose Add trigger.
The Triggers panel for Check my website: a daily schedule that is on, and a webhook, each with an On/Off switch.
The flow's triggers. Each one has its own On/Off switch and says when it last started a run.

That's it. Every morning, the flow runs by itself. Each trigger in the list has an On/Off switch, and says when it last started a run. To pause it for a while, switch it off. Delete removes it.

You can schedule a flow every 15 or 30 minutes, every hour, daily or weekly. If a scheduled start is missed by more than five minutes, it's skipped rather than made up later, so a flow never runs twice in a row to catch up.

Tip

Want to hear about it only when something's wrong? End the Needs a look path with a step that tells you, such as an Approval (which emails your team) or a command that posts to your team chat.

2. Start a flow from another app

A webhook gives a flow its own web address. Anything that can send a web request can start it: a form on your website, a monitoring alert, a Zapier or Make step, or your own code.

  1. In Triggers, under Add a trigger, choose Webhook.
  2. The builder shows the address, a token, and a ready-made Try it command.
  3. Copy the token now. It's shown only once. If you lose it, delete the trigger and add a new one.

Paste the address and token into the other app. If it lets you send data, send it as JSON, like this test from a terminal:

Terminal
curl -X POST https://api.quietrobot.ai/api/v1/hooks/flows/trg_123 \
  -H "X-QR-Token: qrt_..." \
  -H "Content-Type: application/json" \
  -d '{"customer": "Sam", "order": 4821}'

Whatever the other app sends reaches the run:

  • in the sandbox, as the file .qr/trigger.json, so a step can read it (cat .qr/trigger.json);
  • in an AI step's prompt, as {{trigger}}. Choose Insert… and then What started the run.

That's how the customer-email flow from Tutorial 5 can answer real emails: point your contact form at its webhook, and have the first step read the message from .qr/trigger.json instead of using a sample.

Careful

Anyone with the address and token can start the flow, and what they send reaches the run. Keep the token secret like a password, and keep an Approval before any step that does something real with what was sent.

3. Start a flow when code changes on GitHub

If your team keeps code on GitHub, a GitHub trigger starts a flow when someone pushes commits, opens or updates a pull request, or publishes a release.

  1. In Triggers, under Add a trigger, choose GitHub event. Pick the events, and optionally the one repository it's for (owner/name).
  2. The builder shows a payload URL and a secret. Copy the secret now: it's shown only once.
  3. In GitHub, open your repository's Settings, then Webhooks, then Add webhook. Paste the payload URL, set the content type to application/json, paste the secret, pick the same events, and save.

Only GitHub can start the flow this way: every delivery is checked against the secret. The run gets a short summary of what happened: the repository, the branch, the commit or pull request, and who did it. The PR reviewer recipe is a good flow to try this with.

Who a triggered run belongs to

A triggered run starts as the person who added the trigger, with their limits. If that person leaves your organization, the trigger stops starting runs and says why in its list. Adding, deleting and every start are written to your audit log.

What you learned

  • A schedule runs a flow every 15 minutes up to weekly, in UTC.
  • A webhook lets any app start a flow and pass it data, which the run reads from .qr/trigger.json or {{trigger}}.
  • A GitHub trigger starts a flow on pushes, pull requests or releases.

Next

In Tutorial 7, you'll see your flow as text: handy for copying a flow, sharing it with a teammate, or making many small changes at once.

  • Agent PlaygroundQuickstart: build and run your first flow
  • Agent PlaygroundBlocks
  • Agent PlaygroundRecipes
  • SandboxesQuickstart: your first sandbox
  • SandboxesMCP server
  • SandboxesAPI reference