Guide · · 6 min read
Put an agent on a schedule: nightly checks, webhooks and GitHub events
A flow you have to remember to run is a flow that doesn't get run. How to start an Agent Playground flow on a schedule, from a webhook or on a GitHub pull request, with three example flows and the same limits and approvals as any run.

A flow you have to remember to run is a flow that doesn't get run. The tests get checked when someone thinks of it. The support form gets read when someone has a spare minute. The pull request waits for whoever is free.
In Agent Playground, a trigger starts a saved flow by itself. There are three kinds:
| Trigger | Starts the flow |
|---|---|
| Schedule | Every 15 or 30 minutes, hourly, daily or weekly. |
| Webhook | When another app sends a request to the flow's own address. |
| GitHub | On a push, a pull request or a release in a repository. |
This guide walks through one example flow for each. First, the part that matters most.
A triggered run is a normal run
Each start is a normal run. It has the flow's limits on loops, time and spend, the flow's policy, your organization's rules, and the same Approval boxes. It shows in Recent runs like any other, with the same replay. Nothing about a run changes because nobody pressed Run.
That's what makes it reasonable to hand the start button to a clock, a form or GitHub. The limits live outside the agent and are checked on our side, so a run started at 2 a.m. stops at its limits as surely as one you're watching. A step that does something real still waits for a person, who can approve from the Approvals page in the dashboard or from the approval email.
Add a trigger
Open a saved flow and choose Triggers in the builder's toolbar. On a phone or narrow screen, it's under More. You can also choose the Triggers chip above the flow's first step. Choose Add trigger, pick a kind, and fill in the details.
Each trigger has an On/Off switch, says when it last started a run, and shows why if a start didn't happen. A flow can have up to 10 triggers, of any mix. Tutorial 6 sets up a schedule and a webhook in about ten minutes.
Flow 1: a nightly check that fixes what fails
Every night, run the tests. If they pass, finish quietly. If they fail, let an agent fix the code, then ask a person before a pull request is opened.
To set it up:
- Start from the Agent fixes the failing test recipe, change its first step to get your code, and set the agent's Check that it worked to your test command. Or draw the flow above.
- Put an Approval box before the step that opens the pull request, so nothing goes out without a yes. The Fix, review, ship recipe shows the same pattern.
- In Triggers, add a Schedule, pick Daily and a time. Times are in UTC, so for 8:00 in the morning in New York pick 13:00 (12:00 in summer).
- Press Simulate and check At most, the most one run could cost with your limits. A nightly flow runs about 30 times a month, so that number is worth a look.
Pick the time with the approval in mind. The run's Time limit keeps counting while it waits for a person, up to an hour at most. If nobody answers in time, the run stops and no pull request is opened. That's the safe way round, but it means a flow with an approval works best when someone will see the email within the time you allow. And tick Go back here if a limit stops the run under Advanced on the step that sets up your code, so a stopped run won't leave a half-finished fix behind.
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.
Flow 2: a form or support tool that drafts a reply
A webhook gives a flow its own web address. Anything that can send a web request can start it: a contact form, a help desk, a monitoring alert, or your own code. When you add one, the builder shows the address and a token, with a ready-made Try it command. The token is shown once, so copy it then.
Whatever the other app sends reaches the run. In the sandbox it's the file .qr/trigger.json, so a step can read it. In an AI step's prompt it's {{trigger}}: choose Insert… and then What started the run.
Here's a support flow built that way. Claude sorts each message, drafts a reply to a question, and a person approves before anything goes back to the customer.
The Support inbox triage recipe is a good start. It sorts a ticket into refund, bug, how-to or spam, sends refunds to a person, and saves a drafted reply without sending it. To connect it to real messages, add a Webhook trigger, point your form or help desk at the address, and have the first step read the message from .qr/trigger.json instead of the sample.
Two habits keep this safe:
- Treat the token like a password. Anyone with the address and token can start the flow, and what they send reaches the run. If it leaks, delete the trigger and its address stops working at once.
- Keep an Approval before anything real. A message from outside is text to sort, not instructions to follow. The recipe's prompt says so, and an Approval before the reply goes out, or a refund is recorded, means a person reads it first.
Flow 3: review every pull request
A GitHub trigger starts a flow when someone pushes commits, opens or updates a pull request, or publishes a release. Pick the events, and optionally the one repository it's for. The builder shows a payload URL and a secret, shown once. In your repository on GitHub, open Settings, then Webhooks, then Add webhook, paste both in, set the content type to application/json, and pick the same events.
The PR reviewer recipe is built for this. It checks out the pull request, lints it, runs its tests, drafts review notes, and waits at Post review? for a person. If there's nothing to say, it finishes quietly. Swap the notes step for an Ask AI step that writes the review from the lint and test output, and add a GitHub trigger for pull_request events.
Every delivery is checked against the secret, so other senders can't start the flow this way, and a delivery sent twice starts one run, not two. The run gets a short summary of the event: the repository, the branch, the commit or pull request, and who did it.
Who a triggered run belongs to
A triggered run starts as the person, or the API key, that added the trigger, with the same limits. If that person leaves your organization, or the key is revoked or reaches its spend cap, the trigger starts nothing and says why in its list. Adding a trigger, deleting one and every start are written to your audit log.
Try it
- Open Agent Playground and pick a recipe: Agent fixes the failing test, Support inbox triage or PR reviewer.
- Run it once by hand, and press Simulate to see what a run costs.
- Add a trigger, and keep an Approval before any step that does something real.
Triggers covers every option, including adding triggers from your own code, and Limits and safety covers what every run gets, however it starts.