Skip to main content
A routine is a saved prompt that Pinework gives to one agent on a schedule. Each scheduled tick starts an agent run, unless the last one is still going. The dashboard lists routines on the Automations page. The CLI calls them automation.

Before you start

  • You have an agent in your workspace. See Create an agent.
  • For the CLI tab, you have signed in with pinework login.
  • You know when the routine should run, as a time of day or a 5-field cron expression.

Create the routine

1

Write the routine

  1. Open Automations in the sidebar.
  2. In the Routines section, click New routine.
  3. Enter a Name.
  4. Under Runs, keep Schedule selected.
  5. Pick how often: Every hour, Every day, Weekdays, Every week or Every month.
  6. Set the time of day, except for Every hour. Set the timezone. It starts as your browser’s timezone.
  7. In What to do, write the prompt the agent gets on each run.
  8. Pick the Agent.
  9. Optional: set Runs on to Cloud or Device, and pick a Model. Both default to the agent’s own setting.
  10. Click Create routine.
To type a cron expression, click Use cron instead. The field takes 5 fields and no seconds, such as 30 8 * * 1-5.
When it works, the dashboard shows a “Routine created” toast. The routine appears under Routines with its schedule in words and “Never ran”. The CLI prints the routine as JSON. Its id starts with aut_ and its status is active.
2

Run it once now

Test the prompt without waiting for the schedule.
Open the routine’s More actions menu and click Run now. The routine’s own page also has a Run now button.
When it works, the dashboard shows a toast that the run started, with an Open run link. The CLI prints "kind": "triggered" and the new runId.
3

Read the result

When the run ends, the agent’s final reply appears as a message in a direct message with the agent. The direct message belongs to the person who created the routine. If an agent created the routine, the reply goes to the company owner. A run that ends with an empty reply posts nothing.Open the routine from Automations to see its Run history. Each row shows the run, its status, what started it and when. The cards at the top count successful, failed and total runs over 7 days.

Change, pause or stop a routine

  • To change it, open its More actions menu and click Edit. Changes apply from the next run.
  • To pause it, turn off its switch in the Routines list, or click Pause on its page. Turn the switch on or click Resume to restart it.
  • To stop it for good, click Archive. Pinework archives routines and never deletes them. Click Unarchive to bring one back.
  • To copy it, click Duplicate.

Start a routine from an event instead

A routine can also start on an event rather than a clock.
  • On a GitHub pull request: pick GitHub under Runs in the dashboard, or pass --event pr-merged or --event pr-checks-passed with --repo owner/name. Your workspace needs GitHub connected first. See Connect GitHub.
  • On an HTTP POST from your own system: see Start a run from a webhook.

Fix a routine that does not start

A scheduled tick or Run now is skipped while the routine’s last run is still queued or running. The skipped tick is not queued for later. Wait for the run to end, or cancel it with pinework run cancel <run_id>.
A paused or archived routine does not start runs, from the schedule or by hand. Resume or unarchive it first.
Pinework takes standard cron with minute, hour, day of month, month and day of week. It has no seconds field. 0 9 * * 1-5 means 09:00 on weekdays.
--agent me works only when an agent runs the command. Pass the agent’s agt_ id or @handle instead.

Start a run from a webhook

Start a routine’s run with a POST from your own system.

Runs

What a run is and how to read its trace.

Cloud and device

Choose where each routine run happens.

Run a workflow

Run several agent steps in order and watch each one.