Routines
How a task becomes a routine, what starts it, and how to change it.
How a task becomes a routine#
- Exploration. The agent does the task once. Anything that would change something (archive, send, delete) is only simulated, and you see exactly what would happen.
- Routine. If you like the result, tap "Turn into a routine". Pimpo writes code with tests and checks it against what the agent did. You can read the code on the routine's page.
- On its own. The routine runs on schedule without a model. If a service changes and the routine breaks, you get a notice with "Redo with the agent", and the agent fixes it.
Routines that react to something new#
Ask for a reaction instead of a time ("tell me when an email from Ana arrives", "when this site publishes something new") and the routine watches instead of running on a clock. Pimpo checks the source every few minutes without any model, so the checks cost nothing, and runs the routine only with what it has not seen before; the first check only learns what is already there. Change how often it checks in the routine's settings. The empty checks stay out of Activity; what was found and what the routine did show up as usual. The gallery's Email from someone important is one.
Routines that watch Gmail or Slack can also hear of new things as they happen: in the routine's settings, turn on Hear of it as it happens. Gmail then tells Pimpo about new mail at once (the administrator sets up Google Cloud once; see Push triggers), and the settings show until when the push is active; Slack messages in the channels Pimpo's app is in, and mentions of it, arrive as they are sent (ask for "when someone mentions Pimpo in #support, tell me"). What arrives reaches the routine as data, never as orders. Each person's push wakes only their own routines. If the push stops (Pimpo was off, Google sign-in expired), the routine simply goes back to checking every few minutes.
A routine can also write a little: "and tell me in one sentence what she is asking for", "suggest a reply". The part that must be composed is written by a small model (the one set for judgments) for each item, about a fraction of a cent each; everything that can be copied (sender, subject, date) stays plain code. Each text is checked against the daily limit first, shows up in Activity, and treats the email as data, never as orders. What the routine then does with the text still passes your rules and approvals.
Routines that remember, and routines built from others#
A routine can keep small values between runs: yesterday's price, the items it already sent, a weekly total. Ask naturally ("only tell me if the dollar went up since last time") and the routine keeps what it needs. The routine's Memory tab shows what it kept and clears it; nothing is kept from a run that failed, and at most 64 KB.
A new routine can also run a routine you already have and use what it returns ("every morning, count today's appointments using my agenda routine"). The new one must declare everything the other touches, so reusing a routine never widens what the owner approved; if the other routine later needs more, the new one stops and asks to be redone. Routines can use others up to three levels deep and never in a loop. Gallery routines cannot use others, since your routines do not exist on other machines.
Routines in a repository#
Routines › Repository keeps your routines as files in a folder you choose, ideally a git repository: routines/<id>/routine.js (the code), routine.json (name, description, manifest) and tests.json. Send routines to the folder writes them and makes a local commit; Publish (git push) sends them to the remote only when you click it. Fetch changes (git pull) runs git pull --ff-only (a local edit is never overwritten) and lists every new or changed routine with its tests already run and what it would start being able to touch. Nothing is installed until you click Install or Update, and it is checked again at that moment; a routine that fails its tests, or has none, cannot be installed. Pimpo looks at the repository every 15 minutes and tells you once when something changed. Routines there can be reviewed in pull requests like any code.
Changing a routine without code#
Every routine page starts with Routine settings:
- When: every day, weekdays, some days of the week, once a month, every few hours, or a cron expression under "Advanced (cron)".
- The routine's own choices: a city (search by name), a limit, a list of words, a currency, whatever the routine was made with. Pimpo's compiler turns anything personal in your request into one of these, instead of writing it into the code.
- Where to notify: one or more destinations. These can be your Telegram, other Telegram bots (a family group, for example), WhatsApp, Slack, Discord or email. With none chosen, Pimpo uses your usual channel.
To add more Telegram bots, go to Connections › Extra Telegram bots. Create the bot with @BotFather, paste its token, send it a message (or add it to a group), and tap Detect chat.
Run history#
Routines › Runs lists every run of every routine, newest first, with its cost, how many calls it made and how long it took. Failed shows only what went wrong, with the error. A routine can run as often as every 5 minutes (Every few minutes in its schedule).
Routines that ask you#
A routine can ask you something and act on your answer: "every night ask me if I worked out and count the week's workouts", "ask before archiving". The question arrives with its options as buttons in Needs you and on Telegram, as buttons on WhatsApp (a list when there are more than three), and numbered on Discord, Slack and Signal; your answer runs the routine again, which records it or does what you chose. You can also answer in words: type it in Needs you, or reply to the question on a channel, with the option's number, its name or just the start of it ("swim" for "Swimming" works when no other option starts that way; case and accents do not matter). An answer that is none of the options is not taken: Pimpo shows the options again. Sending an option's exact name without replying also answers the question you were just asked, as long as you have not written anything else on that channel since; otherwise it is an ordinary message. A new question replaces the same one still unanswered, and a question expires after 24 hours.
Reminders#
Ask in any chat, in the app or on a channel: "in 30 minutes remind me to check the deploy", "remind me tomorrow at 9 to call Ana". Pimpo sets a reminder that goes out once, where your notices go, and is gone; nothing is turned into a routine. Pending reminders are listed at the top of Routines, where each can be cancelled. One that falls due while Pimpo is closed goes out when it opens, saying it is late. What repeats ("every Monday…") is a routine instead.
Long jobs#
For work too big for one answer ("compare these 20 suppliers on price, delivery and reviews and prepare a proposal"), open Jobs, describe it and give it a budget (up to $20). Pimpo first shows a plan: up to eight parts, each with only the tools it needs. Nothing runs until you tap Start. The parts then run in the background, three at a time, for as long as they need (up to 90 minutes each); like the chat, they read for real and only propose changes. Jobs shows each part's progress and cost against the budget; when the budget runs out, the job stops and says so. If Pimpo restarts, finished parts stay finished and interrupted ones start again. At the end a report puts the parts together, and you are told on your usual channel.
Progress is kept, not just shown: Home lists what is running now, and each job and each routine shows its parts or steps, the step it is on (by the part's or the tool's name), the cost so far and when it last moved. A reload, the phone or a restart shows the same thing; a job picked up after a restart says so, and a routine run a restart cut short says it was interrupted. Turn on Follow on my channels on a job (before starting it or while it runs) to get one message about it on your channels: on Telegram, Discord and Slack that message is edited in place as the job goes, at most every 10 seconds, and ends with the result; on channels that cannot edit a message (Signal, WhatsApp, iMessage) you get only the start, and the notice at the end. Each person sees only their own progress.
Suggestions#
Once a day Pimpo may notice something you repeat and offer a routine: "you pay this bill every month; want a routine for it?". The suggestion arrives in Needs you and on your channel, and says what Pimpo would do. Yes, learn it starts it the usual way (you watch it once and approve it); No, thanks makes sure it does not come back. For this Pimpo looks only at who writes to you and about what, your upcoming events and your routines, never at what emails say. Turn it off in Settings › Notifications › Suggestions.
This page is built from the repository's documentation. Improve it on GitHub.