environment_not_verified. See Agents and Verify the setup script. Slack and GitHub triggers also need an event source: connecting Slack or GitHub on Integrations creates one. See Receive events. Creating automations and starting runs by hand needs create permission, changing, pausing, and resuming them needs update, and deleting needs delete. Organization developers and admins have all of them. See Organizations and roles.Create an automation
Choose the agent version, environment, and instructions, then add the triggers that should start runs.- Console
- cURL
- In the sidebar, click Automations, then click New automation. To start from a ready-made automation, click Start from a template at the top of the form and choose one; it fills in the name, triggers, and instructions, and you still choose the agent and environment.
- Name it, choose the agent, its version, and an environment.
- Under Instructions, write what the agent should do each time.
- Add triggers: Scheduled, Slack, or GitHub. With none, the automation runs only with Run now.
- Optionally set Credential access, Files, and, under Advanced, Run metadata.
- Click Create automation. It starts paused.
201 response is the full automation, with status paused and a revision. Some fields are left out here.
ETag response header is an opaque validator; send it unchanged as If-Match on the next change. Do not construct it from the body’s revision. New automations start paused: test one with Run now from its row’s Actions menu, then resume it so its triggers can start runs. See Run, pause, and resume.
Required fields
Required fields
displayName, agentId, agentVersionId, environmentId, initialPrompt, runDefaults (at least metadata, which can be null), and triggers (an empty list for manual runs only). You choose each triggerId yourself, as a UUID, and keep it stable across replacements. A trigger id stays with its automation: a new trigger needs a new UUID, even after the trigger or automation that had the old one is deleted.Retries, Idempotency-Key, and If-Match
Retries, Idempotency-Key, and If-Match
ETag, quotes included. A missing If-Match returns 428 precondition_required; a stale one returns 412 precondition_failed. A public contract change can invalidate an ETag even when the body’s revision is unchanged: read the resource again before retrying. See Idempotent mutations and Errors.Choose triggers
An automation has up to 20 triggers, and a run starts when any enabled one matches. The trigger types areschedule, slack, github, and webhook. Turn a trigger off with enabled: false to keep it without it starting runs. You can also start a run by hand at any time, even while the automation is paused.
Schedule
Starts runs on a cron expression read in a time zone, such as the create example’s0 9 * * 1-5 in Europe/London: 9:00 on weekdays. By default, an occurrence is skipped while the previous run’s session is still going.
Schedule fields
Schedule fields
schedule object. Every one you save is applied to the schedule.Overlap policies
Overlap policies
Check a schedule's status
Check a schedule's status
getAutomationStatus returns the same values for each schedule trigger:Slack
Starts a run for Slack messages. It needs a Slack event source: connect Slack on the Integrations page. Choose themessage or app_mention event and the channels to accept. This trigger starts a run for each new top-level post in an incident channel that mentions a severity, and ignores other Slack apps:
- Filter
messagetriggers by text. Without a text filter, every new message in the trigger’s channels starts its own run and a paid session, with no cap. The editor warns about this but still saves. AddtextContainsortextMatchesso only the messages you mean start work. - Filter by sender group. For channel messages, add Sender is in user group or Sender is not in user group and choose an
@handlefrom the selected Slack connection, or enter a Slack user-group ID (S…) directly. The picker saves the group’s ID, so renaming its handle does not change the filter.fromUserGroupIdsaccepts a person who belongs to any listed group;notFromUserGroupIdsaccepts a person who belongs to none. When both are set, both conditions must hold. These filters cannot be combined with DM access. Membership comes from the connected workspace and is refreshed at most every 30 seconds. A deleted or disabled group makes only the trigger that references it fail closed; temporary membership read failures retry the delivery. A custom app missingusergroups:readalso fails only the group-filtered trigger closed; add that scope in Slack, choose Update bot scopes on its connection, and authorize again. Bot and app messages do not match either condition. The Slack installation needsusergroups:read; reconnect an older Recursion-app installation if it lacks that scope. - Call an agent by a Slack user-group @handle. Open the agent’s Slack tab to create a group in a connected workspace or associate an existing group by its
S…ID. The group’s mention handle is also the name the agent posts under when that handle is active; otherwise it posts under the agent name. Then choose Agent mentioned in the automation’s Slack trigger; the selected agent’s group is used automatically. Creating or changing a group through RMA needsusergroups:read,usergroups:write, and workspace permission to manage user groups. To give the agent’s posts a custom picture, upload a Logo in the General section of the agent’s Configuration tab: a PNG or JPEG of up to 1 MiB and 2048 pixels a side, where square works best (see Limits). It is saved at once, without saving the agent; new sessions use it straight away and running sessions within five minutes. Uploads larger than 512 pixels a side are scaled down. Slack loads the picture from a public link, so anyone who has that link can view the logo; it is never listed, and the link changes with every upload. Without one, posts carry the Slack app’s default icon, and messages already posted keep the picture they were posted with. An agent set up with the older Slack reply picture, an image URL or emoji in itsmetadata.slack_reply_icon, keeps using it until it has a logo; the console no longer edits that field, which API clients can still set, and the General section shows it with a Clear action. The name and picture go on the agent’s replies and on what the platform posts for it while it works; see Acknowledge a Slack post. Custom names and pictures needchat:write.customize; reconnect older Recursion-app installations to request the scopes. Adding people to the group would notify them on every mention. Slack sends a user-group mention as amessage, not anapp_mention. RMA matches the ID in Slack’s mention token, so renaming the group’s handle does not require changing the trigger. Clear handle removes the binding so the agent can be set up with another group. A matched group-directed post takes precedence over broad message triggers on the same event source. When no Agent mentioned trigger matches, a post that tags an agent’s active handle goes to that agent’s own Slack message triggers, never to another agent’s, and an AI filter on them always wakes the agent for it. A post that tags the handles of two agents starts nothing. Mentions of workspace groups that no agent owns, such as an on-call rotation, are ordinary text: they leave broad triggers eligible, and an AI filter judges the message by its content. - Agents tag people and groups the way a person does. In a Slack reply, an agent writes
@handlefor any member or user group of the connected workspace, or copies a<@U…>or<!subteam^S…>mention it read, and RMA turns it into a live tag. Nothing needs configuring per agent. People and groups outside the workspace (Slack Connect), deactivated members, disabled groups, handles that match more than one member or group, and@here,@channeland@everyoneare never tagged and stay plain text, and the agent is told which tags went live. The one exception is the@reporterslot, which tags the thread’s root author wherever they belong. A user group is tagged only in the thread the agent is answering (the one it was started from, or a conversation handed to it), and only when that channel is not shared with another organization (Slack Connect), so a partner in that thread cannot steer the agent into paging an internal team. A scheduled automation has no starting conversation, so it can tag a group in any channel it posts to that is not shared with another organization (for example a weekly summary that cc’s@team); a message a member of your organization sends into that session through the console or API is trusted like the automation’s own prompt. Only runs the schedule itself starts can do this, and the destination must be confirmed as not shared, which needschannels:readorgroups:readon a custom Slack app. A Run now or Run with input test, or a session started by an email, a webhook, GitHub or the API, tags no group, so test a group tag on a scheduled occurrence. Elsewhere a group stays plain text. The check covers what steers the agent, not everything it reads: if it reads a shared channel elsewhere, that text can still lead it to tag a group where it may. Person tags are not limited this way, bots and apps are never tagged by@handle, and one reply tags at most 25 people and groups. This applies to the agent’s plain Slack replies (slack_post_messageand thereplytool), except report-feedback outcomes, which render as plain text and resolve no mentions.slack_post_blocks,slack_update_messageand the text of a file upload resolve no@handleand pass a written<@U…>through. In a workspace with more than about 2,000 accounts (deactivated accounts, bots and apps included), or when Slack is slow to list them, no@handleis resolved; only a copied<@U…>or<!subteam^S…>tags anyone. Tagging by@handleand group tags needusergroups:read; without it only a copied<@U…>is tagged, so reconnect an older Recursion-app installation if it lacks that scope. A question with choices may be posted as buttons, which tag no one, so an agent tags people in a reply without choices. - One post starts one run. Slack sends a message that mentions the app as both a
messageand anapp_mentionevent. One post starts one run per automation, even when a trigger lists both events or two of its triggers each match. - Every Slack event starts a new session, unless the trigger continues its thread. By default a reply in the same thread starts another run with its own session. Set
continuationtoresume_threadand a later matching post in a thread is delivered to that thread’s session instead, with its transcript and workspace. See Continue a Slack thread.
Slack trigger fields
Slack trigger fields
channels:read to list public channels and groups:read to list private channels. The same list is available from the API for a Slack connection:fromUserIds come from the connection’s member catalog, read with the same connection:Allow personal tasks from Slack
To let a Slack requester approve a private task using supported personal integrations, connect the Slack event source to an app, then enable Allow personal tasks on the Slack trigger. It defaults to off. With the default new-session-per-message continuation, each eligible signed human message gets the tools under its trigger’s current setting, including replies in existing or bot-opened threads. With resume-thread continuation and DMs, the opening human turn decides whether the session has the tools, and later human turns are checked against their own trigger snapshot. It applies to humanmessage and app_mention turns in ordinary
workspace channels and DMs; Slack Connect shared channels and slash-command-only
triggers without Available in Slack DMs cannot start personal tasks. A
DM-only trigger can enable personal tasks; a member direct-message trigger cannot,
because the bot cannot deliver its approval prompt there. The requester has 30 minutes to approve and must link their
Slack account to Recursion and approve the exact integrations and read-only tools the
agent requests. Personal integrations are currently available for supported connected services
in the requester’s personal organization. The requester needs the developer, admin, or owner tenant role
to link for this flow. The
resulting task session is private to the requester. When it
finishes, only the requester sees a draft reply in Slack. Approve post
publishes that exact reply to the original thread; Discard keeps it private.
Agents requiring independent Slack reply review cannot use personal tasks in this version.
The private run, draft review, and approved post each have a one-hour window.
For a custom Slack app, enable its App Home → Home Tab in Slack so requesters
can confirm their account link, and subscribe to the app_home_opened bot event.
The private run has no team sandbox, skills, toolsets, web search or fetch, artifact
tools, sub-agents, MCP servers or vaults, memory, or oversight. Grant im:history in DMs, both channels:history
and groups:history for channels, and both groups:history and
mpim:history for group conversations. Slack IDs alone do not distinguish
public from private channels or private channels from group messages.
Make an agent available in Slack DMs
Giving a trigger DM access stops it from starting report-comment investigations; keep a separate enabled Slack channel trigger for those investigations. In the automation’s Slack trigger, enable Available in Slack DMs. In the API, set"dmEnabled": true on that trigger. Choose Direct messages only (or set
"events": [] with "dmEnabled": true) to accept DMs without channel events.
DM access defaults to off. Keep the
automation active and its trigger enabled for it to be offered in DMs.
DM the connected Slack app with your task. If one automation is available to
you, it starts on your message straight away, in a thread under its reply (a
message with no text opens the thread and waits for your task). If
several are, and no more than 20, your message goes to the one you started a DM
conversation with most recently, within the last 30 days, and its reply has a
Switch agent button that shows the picker; choosing another agent there
starts it on the same message, and the first agent keeps working in its own
thread. If you have not used any of them recently, or more than 20 are
available, choose one from the picker and it starts on the message you sent.
Each thread talks to one agent; send a new message to the app to start a fresh task.
If an agent has several available automations, their automation names distinguish
the choices. The automation supplies its saved agent version, environment,
credentials, and budget.
The From filter restricts who can see and use the automation in DMs. Without
it, users in the connected workspace can invoke it. Channel, mention, event, and
text filters continue to control channel traffic; they do not restrict DMs. A
slash command or message shortcut used in a DM is the exception: its trigger’s
events, commands, shortcut callback IDs and channel routing still apply, with
the DM as its channel.
Custom Slack apps need chat:write, im:history, and im:read to offer DMs and reply. Older Recursion-app connections may need reconnecting to grant im:history and im:read. The Slack
app must also subscribe to message.im events and have its Messages tab enabled.
Turn off DM availability to stop offering the automation in DMs and stop new
messages reaching it through existing DM threads. Pausing the automation or
changing its agent also stops those conversations. Group DMs and externally shared DMs are unsupported.
Continue a Slack thread
With"continuation": "resume_thread", an automation keeps one conversation per Slack thread. Every matching post still records a run, and the run’s sessionAction says what it did:
- A conversation belongs to one automation and one thread. Two automations that both continue the same thread keep separate sessions, and a thread in another channel, workspace, or organization never reaches this one.
- Report investigations keep their own policy. Their replacement and recovery rules are in Investigate report feedback.
- A resumed session keeps its agent version. Publishing a version and moving the automation’s pin changes new threads only. To change the version a thread’s session runs, move that session.
- Posts that arrive together join one session. The first one starts it and the rest are appended, each exactly once, in the order they were admitted.
- A refusal that can pass is retried, not replaced. If the session is still stopping, its input queue is full, or the tenant is out of credit, the run stays
pendingand is delivered when it can be. - A thread’s runs have no result of their own. They share one session, so reading a run’s result is refused with
422 automation_run_session_shared. Read the thread’s session instead. - Give every Slack trigger of an automation the same
continuation,firstResponse,replyFeedbackChannelId,replyFeedbackWakeOnNegativeandreplyFeedbackInvestigateReports. One post that matches two triggers starts one run, so the API rejects triggers that disagree.
message with ignoreThreadReplies for new top-level posts in a channel, and app_mention for replies that mention the app, including replies in that same channel.
Collect feedback on replies
With"replyFeedbackChannelId" set on a Slack trigger, Markdown replies posted with slack_post_message in the thread that woke the agent end with Slack’s thumbs up and thumbs down buttons. Custom block posts, platform choice questions and file uploads keep their existing behavior without added rating buttons.
A click records the rating at once and opens a form, Do you have any additional feedback?, with one optional text box. Sending a comment adds it to that rating’s card; closing the form changes nothing.
In the console, open the automation and use Message feedback, which appears once the automation has a Slack trigger. Turn on Add feedback buttons to replies and choose the Feedback channel. The console lists that Slack account’s channels when every Slack trigger uses the same account; otherwise type the channel ID (C…). To have a thumbs down wake the agent, also turn on On thumbs down, wake the agent with the feedback so it can retry, which needs every Slack trigger to continue the thread’s session. The console writes both settings to every Slack trigger, as the API requires. An automation managed from an agent folder says so in that section: change the setting in the folder, because the next recursion managed-agents apply replaces an edit made in the console.
Each click adds a card to the feedback channel with the rating, rater, source channel, agent, and a link to the reply; a comment sent from the form is added to that card. The card copies nothing else from the reply. Anyone who can see the reply can rate it, and a rater from another Slack workspace is marked external when Slack names their workspace. Repeat clicks post repeat cards.
- On replies, only a thumbs down can reach the agent, and only with
"replyFeedbackWakeOnNegative": true. It wakes the thread’s session with the rating so the agent can look at its reply again and retry, and a comment sent from that click’s form follows as a second event. Each reply wakes the agent at most once: a later thumbs down on the same reply, and its comment, only post to the channel. The rater must be someone whose message in that channel the trigger would accept, under its shared-channel and sender rules. Otherwise no run starts, and a rating costs no model usage. - Invite the app to the channel first. A card the app cannot post is retried for about two hours and then dropped.
- Sessions started before you set this keep no buttons, including their later replies. Removing it stops new sessions from getting buttons; buttons already posted keep working.
- Some posts get no buttons: direct messages and posts outside the thread that woke the agent. Scheduled reports have their own channel setting below.
Collect feedback on scheduled reports
On a schedule trigger, set bothreplyFeedbackPostChannelId to the channel where the report is posted and replyFeedbackChannelId to the channel that collects feedback. These settings are available through the API. The connected Slack app must be a member of both channels, and the agent must already have permission to post the report.
Top-level reports from scheduled occurrences get Useful and Needs improvement buttons, including reports with custom blocks, PDFs or videos. Each click records a rating and opens the same optional comment form described above. The feedback behavior table defines where entries and their follow-ups appear. Ratings alone do not rerun the agent; submitted comments can start an investigation when the owning automation opts in below.
Both channel fields are required together; omit both to turn scheduled feedback off for new sessions. Manual runs, thread replies, direct messages and posts to a different channel do not get these buttons. Existing feedback buttons continue working.
To show totals on new reports, also set replyFeedbackShowCounts: true. It requires both channel fields and defaults to false. After the first feedback, the report’s footer shows Useful and Needs improvement totals plus the number of people who left a comment. Each person has one current vote; changing a rating moves that vote, and repeat clicks do not increase the totals. Each person with a nonempty comment is counted once. Existing reports are not backfilled.
The feedback channels and counter setting are frozen when a session starts. A continuation: resume_thread schedule keeps its original settings, including having none, for later occurrences in that session. Changing or removing them does not update that session; use a new trigger id or replace its session to apply the new settings.
Investigate report feedback
An automation can investigate comments on its scheduled reports. With Save improvements for future reports and memory enabled, it can use validated corrections in later reports. EnablereplyFeedbackInvestigateReports: true through the API or agent folder.
Add an enabled Slack trigger to the report’s automation with continuation: resume_thread. Set replyFeedbackChannelId to the schedule’s collection channel saved when the report session started. Saving does not check that these channels match; a mismatch saves successfully but never investigates that report. All Slack triggers must agree on the investigation setting and collection channel, so an automation can investigate only one schedule collection channel.
Route the collection channel and set sender filters on every eligible Slack trigger. Any enabled non-DM trigger on the report’s Slack connection can allow a comment; restrictions on one do not restrict a broader sibling. Triggers with dmEnabled: true or memberDirectMessage never allow report investigations. People submit feedback from the report and need not belong to the collection channel.
- Applied: workspace/channel routing,
allowSharedChannels, and the sender filtersfromUserIds,fromUserGroupIdsandnotFromUserGroupIds. Empty routing matches every channel. - Not applied to report-comment callbacks:
events, text filters,classifier,mentionUserGroupIdandignoreThreadReplies. These still govern ordinary Slack posts; use routing and sender filters to restrict report investigations.
allowSharedChannels: true. A custom app needs channels:read for each public channel or groups:read for each private channel to check sharing on both channels. Without the matching scope, the comment is added to its card but no investigation starts. Add the scope with Update bot scopes on the Slack connection.
The feedback location is fixed by the report’s saved collection channel and any existing feedback entry. An existing standalone entry is a feedback card posted outside the report thread before threaded collection was introduced:
events: ["app_mention"] over message to avoid responding to every collection-channel post. Report investigations use dedicated sessions even when ordinary conversations use unowned: coordinator; the first verified comment replaces an ordinary session holding that thread. Questions, clarifications and choices follow Reply in the conversation. Ordinary replies continue the investigation with its original feedback mode only if they match an enabled Slack trigger. A reply that arrives while the investigation is still starting waits for it. If a successor fails to start, a later reply can continue its predecessor with the same feedback mode, as long as it still exists and runs the automation’s current agent (or is the subagent it handed the thread to). A failed fresh investigation cannot return to any earlier session; ordinary replies in that thread fail until a new report comment starts an investigation. Before a comment elects a fresh investigation, the automation must still exist and name the agent that admitted the comment; otherwise the comment’s run fails. This applies to both collection layouts, including a report thread’s first comment and each new separate-channel entry. An already-admitted comment can still join its same-agent investigation or continue it as an inherited-mode successor under its snapshot; retries of an already-elected start also retain that election. To select a different agent, submit a new report comment admitted for the current agent. Moving the automation to a new version or saving-mode setting for the same agent affects newly admitted investigations; an existing investigation and the later comments that join it keep its frozen mode.
A comment on a live investigation paused at its budget is collected, but its investigation run fails without an outcome or an extra Slack note. Raise the budget, then rate the report again with a comment; this adds another feedback entry, and the original entry remains without an outcome. A new comment for the same agent does not start a separate session to bypass that pause.
If the investigation was deleted, the reply’s run fails and no reply is posted; submit a new report comment to start another investigation. This applies to either unowned setting.
With unowned: coordinator, an ordinary reply cannot replace an investigation that no longer accepts replies. The reply’s run fails and no reply is posted in the thread. If the investigation ended at its budget, raise its budget and send the reply again. Otherwise, rate the report again with a comment to start or continue an investigation. With unowned: start_session, a reply can start a successor under the rules above.
A submitted comment on either Useful or Needs improvement can start an investigation. A rating without a comment only records the rating. Each new rating with a comment creates one run. Redelivery of the same comment does not start another run. Turning the setting off stops new investigations while collection continues.
Setting the collection channel also adds the usual reply-feedback buttons to qualifying Slack replies from this automation, including ordinary conversations and investigations. Those ratings go to the same collection channel. The optional feedback-count footer on the original report is updated, but its content and attachments are not rewritten by this feature. The agent retains its existing Slack access, including any workspace-wide posting or editing permissions.
The automation’s initialPrompt applies to investigations too. Configure it to handle inputs with reportFeedbackChannelId separately from scheduled occurrences: read the report, validate the comment and use the supplied reply target to update the existing feedback entry. Keep the outcome compact, covering the verified result and whether an improvement was saved. The rating and original comment remain in that entry; the outcome adds no new message. This changes the task, not the agent’s permissions.
In the agent’s Configuration → Report feedback, use the Save improvements for future reports switch:
- Off is the default. The agent investigates, validates and makes the requested follow-up fix or reports its finding in the entry’s outcome. The investigation cannot write agent memory or contribute to automatic learning. Its ordinary session transcript and saved files remain subject to the agent’s existing history access.
- On also allows the agent to save a validated, reusable correction for future reports. Enable the agent’s memory and configure later reports to retrieve relevant memories. Existing memory permissions and approval requirements still apply; the switch grants no new access.
metadata.report_feedback_mode to permanent to turn saving on, or temporary to turn it off; omitting the key leaves saving off. The Slack comment form has no persistence control.
Feedback does not authorize changes to tools, recipients, schedules or access. For a folder-managed automation, declare replyFeedbackInvestigateReports in its manifest; omission means false, and the next apply clears an API-only opt-in. Folder apply preserves the live agent’s feedback mode. CLI folder export omits this metadata setting; the console’s Export version JSON includes it.
The automation console has no investigation opt-in control; the agent’s switch does not enable investigations by itself. The console shows whether investigations are requested and flags some conditions that prevent them from starting and preserves the opt-in when feedback buttons or thread continuation are turned off and back on before saving. Saving while either is disabled clears it. Changing the feedback channel keeps the setting but stops investigations for reports whose saved collection channel no longer matches.
Acknowledge a Slack post
With"firstResponse": "platform", the platform reacts to the post, posts an acknowledgement in the thread, and edits that acknowledgement into a live status while the agent works. While the agent works, the status lists its steps as a Slack checklist, except that a coordinator’s pickup line, a line still on its placeholder without a goal, and a line whose session is waiting on a person or is not at work show the plain status (a session that is sleeping or waiting on its sub-agents is at work and keeps the checklist). In a channel verified not to be shared with another organization, the status can show the turn’s goal, what the current step is checking, the earlier steps and how long it has run, and it carries a Stop button anyone in the channel can press; elsewhere the checklist shows the current step and how long the turn has run, with no goal, earlier steps, step count or Stop. Progress shown under a person’s own Slack account lists its six most recent actions in every channel, as a checklist titled Working while one of them runs and as a ✅/⚠️ list otherwise, with no goal, time or Stop. A line registered before its channel was shared, and that line’s stop note, keep their buttons, and a new click on one gets a private note that the control isn’t available. A coordinator’s pickup line and a line that shows progress under a person’s own Slack account carry no Stop, and neither does any line of a custom Slack app without the scopes that read a channel’s sharing (channels:read and groups:read in a channel, im:read in a DM), whose stop note then offers no Continue. When the turn ends the platform’s status line is removed, or replaced by a line saying the run stopped if the session failed or was cancelled; progress under a person’s own account stays as its list with a closing line. It posts through the Slack app that received the event, with the bot token of the workspace’s Slack connection on the Integrations page. The acknowledgement and the status line carry the name and picture of the agent working in the thread, the same ones its replies carry, where the workspace granted the app chat:write.customize; without that scope they appear under the Slack app’s name. The message that opens a direct-message conversation with an agent carries them too. Files the agent shares carry its name too where the app’s scopes are confirmed to include chat:write.customize; the file itself is still owned by the Slack app. Tool-approval cards, feedback cards, the direct-message agent picker, and the platform’s stop note stay under the app’s name. The reaction needs the reactions:write scope. Reconnect an older Recursion-app installation to add it; for a custom app, add it in Slack, choose Update bot scopes in Integrations, and authorize again. Without it the acknowledgement and status line still appear. When the workspace has no active Slack connection for that app, the trigger behaves as none: the run is unaffected, and a failed run still posts its failure note.
Slash commands and shortcuts
A custom Slack app can start runs from its slash commands and shortcuts. Addslash_command, message_shortcut or global_shortcut to a trigger’s events, and optionally narrow them with commands or shortcutCallbackIds. Recursion’s own Slack app and webhook event sources never receive commands or shortcuts, so a trigger that lists these events must use a custom app’s event source; saving it on any other source is refused.
- Where the run happens. A slash command opens a new thread in the channel where it was used, and a message shortcut joins the thread of the message it was used on. When the app can’t post there, such as a channel it hasn’t joined or a DM between other people, the run starts in the person’s DM with the app instead. A command or message shortcut used in the person’s own DM with the app always runs there, as a DM conversation. Each DM case needs exactly one automation with a matching
dmEnabledtrigger; with none or several, nothing starts, and the person is told why when the app can reach them. A global shortcut has no conversation, so it always starts in that DM; its trigger requiresdmEnabledand no channel routing. Turning ondmEnabledalso offers the automation to ordinary DMs. - Who may run it. The trigger is chosen before anything is posted. Routing, sender filters and
allowSharedChannelsapply to the conversation where the person used the command or shortcut. A slash command used in a one-to-one DM reads no sharing: it needs no read scope and noallowSharedChannels, because it runs in the person’s own DM with the app with only their words. User-group filters need theusergroups:readscope, and as with DMs they never admit a run that starts in the person’s DM with the app. When the event source is paused, the person sees the usual acknowledgement and then nothing starts. When nothing matches, nothing is posted. The person gets a private reply saying why, except after a global shortcut when the app can’t write to their DM (noim:writeorchat:write, or its Messages tab is off) or they aren’t a member of its workspace. A conversation the app can’t read counts as possibly shared for a message shortcut, because the message may come from another organization. A slash command used there still starts in the person’s DM. - What the agent sees. For a slash command, the event’s
textis the command followed by what the person typed, such as/billing refund 123, or the command alone. For a message shortcut, the message it was used on isevent.invocation.quoted_message, marked as third-party content. A global shortcut carries only its callback ID. Text filters, the AI filter,ignoreThreadRepliesandbotEvents: allow_externalread messages, so a trigger with only these events can’t set them. - Follow-ups. A run started in a channel thread continues there only if the same automation also has a
messageorapp_mentiontrigger withcontinuation: resume_thread. Replies in a DM conversation reach the automation through itsdmEnabledtrigger. - One run each. One slash command or shortcut starts at most one run per automation, however many of its triggers match.
Messages that never start runs, and stopping a Slack session
Messages that never start runs, and stopping a Slack session
- Only newly posted messages start runs. Editing or deleting a message never starts one.
- Stopping a Slack-started session tells its thread while the thread shows a live status (
firstResponse: platform). Withnone, or once the turn’s status line has closed, a stop posts nothing to the thread. Once the agent has actually stopped, pressing Stop, or interrupting the session from the console, closes the live status (“Stopped by @person” or “Stopped from Recursion”) and posts a note in the thread saying who stopped it, or that it was stopped in Recursion. If the stop cannot be confirmed, a Slack stop’s line says so and no note is posted; a console stop leaves the line as it was. A session stopped through its coordinator closes its line with no note. A console stop leaves a coordinator’s pickup line and a line shown under a person’s own Slack account as they are, with no note. - Continuing from Slack. In a channel verified not to be shared, the note of a session that is not a coordinator carries Continue, which picks the work up where it left off, when a message from the person pressing it in that thread would reach the session: in a channel, a trigger of the stopped turn’s automation that continues the thread (
messageorapp_mention, withoutignoreThreadReplies), other than amemberDirectMessagetrigger, which takes messages only in that member’s own DM; in a direct message, thedmEnabledtrigger that holds the conversation, with no user-group filters. That trigger must still be enabled, the automation active and still on the same agent, and the person must pass its sender filters; its text filters don’t apply, since Continue carries no text. The note also names how to steer the agent where a mention resumes it: the app, when a trigger without text filters (other than amemberDirectMessagetrigger) listens onmessageorapp_mention, continues the thread and keeps thread replies; the Slack group’s handle, when a group trigger without text filters listens onmessage, continues the thread, keeps thread replies and its group is bound to the agent; or a reply in a direct message. A person who does that after the stop resumes it with their message as the new instruction. A plain reply in a channel thread does not; when a trigger takes thread messages, it is kept for when the session is continued. Bot and alert posts, other apps and people outside the workspace never resume it this way. A coordinator, and a session stopped through its coordinator, are continued from the console only. - A force-stop posts nothing to the thread. The console reminds you, so reply there yourself or message the agent to post an update.
Continue a conversation from any trigger
"continuation": "resume_thread" works on Slack, GitHub, webhook, and schedule triggers. IMAP triggers do not take a continuation; every email starts its own session. Each event names its conversation, and every later event of the same conversation reaches that conversation’s session, with the same sessionAction values as a Slack thread:
continuation; the API rejects triggers that disagree. Each event the session receives also carries a channel-neutral envelope in the run’s eventContext.envelope: its channel, actor, text, conversation key, and where a reply would go.
Except for report comments, when a trigger routes unowned conversations to a coordinator (below) and coordinator mode is enabled for the organization, the message each event delivers names its conversation in a Conversation key: <key> line right after the event, for example Conversation key: slack:A0123456789:T0123456789:C0123456789:1700000000.000100. The line is the last one unless the automation asks for a result file or an AI filter woke the run: the sentence that asks for the file, and then the filter’s routing context, follow it. The coordinator uses the key to hand that conversation to a sub-agent. After coordinator mode is turned off for the organization, a conversation the coordinator already holds still reaches it, and its messages keep the line. Every other trigger’s messages carry no such line.
Route new conversations to one coordinator
Report-feedback investigations always use dedicated sessions in their feedback thread and bypass the coordinator, including for their follow-ups and successors. Ordinary follow-up messages can still include the conversation-key line described above. The routing rules below describe ordinary conversations. By default a conversation no session holds yet starts its own session. Set"unowned": "coordinator" on a Slack, GitHub, or webhook trigger to deliver every such conversation to one long-lived coordinator session instead. Each event source has its own coordinator: a Slack app, a GitHub App installation, and each webhook source never share one, so a delivery from one source never reaches a session another source’s events steer. The first event from a source starts its coordinator; later new conversations are appended to it, and a conversation the coordinator hands to a sub-agent keeps reaching that sub-agent.
- A coordinator trigger continues conversations. It requires
"continuation": "resume_thread", and a Slack coordinator trigger cannot setfilters.ignoreThreadReplies: follow-ups in a handed-over thread are thread replies. A trigger withmemberDirectMessage,dmEnabledorprogressUsercan’t use it: each keeps one person’s conversation private or acts as one person, and a coordinator answers many. - Give every trigger of one type on one event source the same
unowned. The API rejects triggers that disagree; triggers on different sources may differ. Schedule and IMAP triggers don’t take it. - The coordinator is replaced when it can’t continue, or once it has run for its rollover period. If it was deleted, can no longer accept messages, ended at its budget, or the automation now names another agent, the next event that reaches it starts its successor, and conversations the old coordinator held reach the successor. A conversation whose sub-agent is gone also returns to the coordinator.
- A coordinator past its rollover period is superseded, not stopped. Every event a coordinator reads stays in its transcript, so each later event costs more than the last. The first conversation no session can take (a new one, or a later post whose session can no longer take it, for example one that was deleted, archived or ended at its budget) that arrives once the coordinator has run for its automation’s rollover period (one day unless you set another) marks it superseded and starts its successor, which takes over its independent sub-agents that are running or waiting on a person (any that has not ended, including one that is asleep or paused). A sub-agent that had already finished stays with the old coordinator: a later message in its conversation resumes it, and a result it then submits goes to the coordinator it is linked to at that time. That is usually the old coordinator, which takes one more turn and then normally ends
superseded; if the old coordinator ends again while the sub-agent is still running, the sub-agent moves to the current coordinator and reports there. The successor starts with that conversation and the current prompt, not the old coordinator’s transcript; the sub-agents and the conversations they hold keep their own context. A coordinator that has not finished and whose tree is at its budget, or one whose organization is out of credit or suspended, is not replaced for its age: its runs are refused at its budget until you raise it, or wait until the organization can start work again. A finished coordinator whose tree is at its budget is replaced as usual, since its next post would start a new session for it anyway. A coordinator that reaches its budget only after it was marked for replacement still hands its running sub-agents to its successor, and they then spend from the successor’s budget. Because a tree’s spend counts the sub-agents linked to it now, every hand-off of sub-agents, including the one when the successor starts, also moves what they had already spent to the successor’s tree: an old coordinator paused at its budget then has room again, by as much as those sub-agents had spent, and can take paid turns for the conversations it still holds without anyone raising its budget. Its own spend stays in its tree. A coordinator that has finished and rests between conversations is replaced the same way by the next conversation no session can take, rather than resumed for it; until then, a post in a thread it holds itself still resumes it. A superseded coordinator that is still working keeps the conversations it already holds, because only the session that holds a conversation can hand it to a sub-agent, and ends at its next turn end with nothing queued and no hand-off waiting for a free slot:status: completedwithstop_reason: superseded, without a grading pass. One that was resting keeps the stop reason it ended with; if it still owes a hand-off a thread limit refused, it takes one turn to retry it now that its open sub-agents report to the successor (at once if it had finished on its own; if it is paused, ended at its budget or otherwise waiting on a person, once someone resumes it, so until then it keeps that alert), and ends superseded once the hand-off is accepted, or once it ends that turn having tried no hand-off and messaged no sub-agent, keeping the alert itself (a later post in that thread then reaches the successor, which has no transcript of it). If the retry is refused again for a thread limit, it finishes as usual and still owes the alert; a retry refused for anything else (a bad argument, policy, or a worker that failed to start) releases it, and it ends superseded keeping the alert. A finished sub-agent it hasn’t archived still counts toward its total thread limit. Once it has ended, the conversations it held itself reach the current coordinator; a message you send it directly still gets one turn. A coordinator is replaced for its age only when a conversation no session can take arrives. - Every new conversation from a source reaches one session. Route a dedicated channel to a coordinator trigger, or filter the trigger, so the coordinator doesn’t read unrelated chatter.
- Work handed to another agent is graded on that agent’s own bar. When the coordinator hands work to an agent on its roster that outlives it (
lifecycle: "independent"), and that agent’s version has adefaultRubric(a pinned version that stores none uses the agent’s current rubric), the agent is graded against its own default outcome, with its task as the objective. An entry without a pinned version uses the agent’s latest version at each hand-off. The agent gets up to its version’sdefaultMaxIterationspasses (five when unset; see Outcome rubrics) and its revisions, and its coordinator hears its result once grading ends. A copy of the coordinator itself is not graded. The automation’srunDefaults.outcomegives the coordinator one outcome, whose objective is the first conversation it receives; later conversations get no outcome of their own. The coordinator is graded once, the first time its turn ends with no sub-agent still running, so that pass can come long after the first conversation and reads every conversation it handled until then; conversations after it are not graded. A successor also counts the sub-agents it took over when it started, which it reads back before its first turn; one the old coordinator hands on later is not in its count until that sub-agent reports or the successor messages it, so its pass can run while such a sub-agent still works. A coordinator that endssupersededbefore any pass ran is never graded. - A Slack thread’s status line follows the session working on it. With
"firstResponse": "platform", the coordinator’s line in a thread shows only the pickup text. When it hands the thread to a sub-agent of the same agent, the same line shows that sub-agent’s progress until it finishes. A sub-agent that is a different agent replaces the coordinator’s line with its own, under its own name and picture. A coordinator that answers a thread itself shows the pickup text until its reply.
Bound a coordinator’s life
Two settings on the automation’scoordinator object bound how long one coordinator session runs and how much context it carries. They apply to every coordinator of the automation, one for each event source, and act only where a trigger routes to a coordinator. Leave the object, or a field, out to follow the defaults, including a later change to them. A response returns coordinator only as you set it. The console’s Coordinator section shows the values in effect: yours, and the current default for each field you left out.
coordinator out clears it; recursion managed-agents apply from a CLI version that knows coordinator keeps the value an automation already has; an older CLI clears it, so update the CLI before you set it in the console.
Reply in the conversation
A session that an automation starts from a Slack or GitHub event gets thereply tool, except one started from a member’s own Slack DM. It answers in the conversation the session started from: the Slack thread or DM, or the pull request or issue as a comment. A sub-agent that its requester hands such a conversation to also gets reply, and answers in that conversation. When a trigger continues conversations, only the session that the conversation’s next message would reach can reply in it. A session that hands a conversation to a sub-agent, or that a successor replaces, stops replying there. reply works without a Slack or GitHub integration grant on the agent. Slack and GitHub tools the agent was granted keep working as before. It can post only where the event came through a Slack or GitHub connection on Integrations, including a custom Slack app; for an event on a signed source you created through the API, reply says there is no conversation to reply in. Sessions started any other way don’t get reply.
An ordinary Slack reply is posted by the same Slack tools as slack_post_message, so it carries the agent’s reply name and picture and follows the same reply review, approval, and status line. A GitHub reply is a comment by the GitHub App, posted only while the repository still has the same GitHub id; a renamed or recreated repository doesn’t receive it. Either way reply uses only tools the connection’s tool selection allows agents and, for a custom Slack app, tools its bot scopes allow.
For a report-feedback outcome, the agent uses the report-feedback: conversation target supplied with the comment. This updates the entry described in Investigate report feedback, preserving its rater, rating and original comment. Write at most two short sentences and 600 characters without Markdown, links or mentions. The outcome renders as plain text, enforces the character limit and refuses choices and attachments. For an older comment with no supplied target, reply normally. Ordinary follow-up replies still post in the same thread.
To ask a question in an ordinary reply, the agent passes 2 to 8 choices and ends its turn. The answer is the conversation’s next event, so reply refuses choices unless the trigger continues conversations ("continuation": "resume_thread", or a Slack DM) and admits an answer: block_actions or message in a Slack trigger’s events (not with mentionUserGroupId), or issue_comment in a GitHub trigger’s. Every answer must also pass the trigger’s filters, so a trigger with any filter gets no choices. On Slack the AI classifier is the exception, because it never judges replies or clicks, and a DM trigger is not filtered. In Slack the choices are buttons when the trigger admits block_actions (a button label is at most 75 characters), and a click reaches the session as a block_actions event naming the choice’s value. Otherwise, and on GitHub, the choices are a numbered list and the person answers in the thread or with a comment. GitHub admission ignores the App’s own reply comments, so a reply never wakes its own session.
Filter events with an AI filter
GitHub, webhook, and IMAP triggers take the same AI filter as Slack, asfilters.classifier. After the trigger’s other filters pass, a decision model answers your question about the event’s text (the comment or review, the delivery body, or the email’s subject and text), and a run whose answer says to skip settles skipped without starting a session. Each evaluation is billed as a classifier call. A simulation doesn’t evaluate the AI filter: a simulated event that passes the trigger’s other filters always reaches the agent, without the filter’s routing text.
GitHub
Starts a run for GitHub webhook events. It needs a GitHub event source: connect GitHub on the Integrations page. This trigger matchespull_request deliveries in acme/api with the action opened or synchronize on fix/* branches, and ignores drafts and bots:
git and gh in the sandbox when the sandbox holds its credential; see Use git and gh in the sandbox. See GitHub access.agent-ready label:
/agent fix:
main finishes with a failure:
GitHub trigger fields and filters
GitHub trigger fields and filters
* matches any characters, including /, and ? matches one character.Webhook
Starts a run for deliveries to a custom webhook source. The console offers this trigger when your organization has a custom source. Addfilters to start runs only for some deliveries. A delivery must meet every condition in every list. This trigger starts runs only for critical or error deliveries of the incident.opened event that have an owner and aren’t muted:
Webhook trigger filters
Webhook trigger filters
- Paths. A
pathis dot-separated, such asdata.level, and a number indexes an array, as indata.tags.0. - Values. Write a
valueas JSON text without quotes:error,2,true, ornull. The value2matches both the number2and the string"2". Objects and arrays never equal a value. - Limits. The four body lists hold up to 20 conditions together. Each list you send needs at least one entry; leave out a list you don’t use, and leave out
filtersto match every delivery. Filters read only the body and the event type, never other headers. - Event types aren’t signed. The signature covers the body, not the header that names the event type. Don’t treat
eventTypesas a security boundary; filter on a signed body field when that matters.
fieldEquals. It shows the other filters read-only and keeps them when you save.Set run defaults
runDefaults applies to every run, whether a trigger or a person starts it.
outcome and output; set them through the API. Saving the automation in the console keeps them.
Grade every run
Give an automation anoutcome, and every session it starts is graded against it, whether a trigger or a person started the run. The run’s result then says whether the work passed. Use it when “the session finished” isn’t proof enough, for example before a CI job merges what an agent produced.
An outcome is an objective and a rubric. Each time the agent finishes its work, a grader checks it against every criterion in the rubric and either accepts it or sends the agent back with what fell short, until the rubric is met or the grading passes run out. Write outcome rubrics explains how to write criteria a grader can check.
Add outcome to runDefaults when you create or replace the automation:
maxIterations.
Outcome fields and rules
Outcome fields and rules
- It replaces the agent version’s rubric. An automation without an
outcomegrades its runs against the stored rubric of the agent version it runs, with the run’s opening message as the objective, and runs them ungraded when that version has none. See Grade every session of an agent. - Saving checks the rubric. A rubric that breaks the rules is refused with
400naming therunDefaults.outcomefield. - Each run keeps the outcome it started with. Changing the automation’s outcome affects later runs only.
- Grading adds to each session’s cost. Every pass runs in its own linked session, and its usage counts toward the run’s session. See Pricing.
Ask for a structured result
When a program reads each run, ask for a JSON result it can parse instead of prose. Declare a result file withrunDefaults.output:
issues, the number of issues triaged, and high, the list of high-severity issue numbers.” The agent saves the file as a deliverable, and the run’s result reads it back as output.
- A declared file is required. If the agent never saves the file, or saves something that isn’t a single JSON value or is
null, a run that would have readpassedorcompletedreadserrorinstead, with the reasonoutput_missingoroutput_invalid. Every other verdict stays as it is. - Without a declared file, the final message is read. When the agent’s last message is a single JSON value, or holds code blocks labelled
json, the result reports that value, or the last block’s, asoutput.nullisn’t a result. When neither holds one, the result has nooutputand the verdict doesn’t change. Ask for it in the prompt: “End your reply with the result as ajsoncode block.” - Every run keeps the path it started with. Changing
outputaffects later runs only.
Result path rules
Result path rules
path is relative to the deliverables folder, as a write_artifact path is: result.json or reports/result.json. It is refused with 400 on runDefaults.output.path when it:- is empty, or longer than 1,024 bytes;
- starts with
/, or with the deliverables folder itself; - has
.or..segments, a doubled slash, a trailing slash, or spaces around it; - ends in a file name that is empty, longer than 255 characters, or has control characters.
valid: false with truncated: true, and the verdict turns to error with output_invalid. The verdict doesn’t check the JSON against a schema; check its shape in your own code.Keep untrusted input in check
Event runs put outside text into the session: Slack messages, pull request and issue titles and bodies, comments, and webhook bodies. Treat that text as untrusted input. Someone who can post in the channel or open an issue can try to steer the agent.- Restricted environments drop
web_fetch. A session an automation starts, or a session started from a Slack thread, gets noweb_fetchtool when its environment limits internet access (limited or no access). The environment’s network policy is then its only way out. - Unrestricted environments keep
web_fetchand full internet access. An injected instruction could ask the agent to send data anywhere. Use a limited environment for automations that read outside text, and grant only the credentials and repositories the task needs. - Webhook runs record only the sender’s headers. The event in a webhook run keeps the headers the sender sent. Headers added on the way to the event source are never recorded.
Run, pause, and resume
Start one run by hand to test the automation, then resume it so its triggers can start runs.- Console
- cURL
- In Automations, open the automation row’s Actions menu.
- Click Run now to start one run, or Run with input to add a JSON payload. Both need create permission.
- Click Resume to let its triggers start runs, or Pause to stop them.
runAutomation answers with the run. What success means: the run moves from pending to created, and sessionId names the session it started. Follow that session like any other; see Sessions. To wait until the work is done and learn how it ended, get the run’s result.
Resume returns the automation with status active. Pausing stops triggers from starting runs; Run now still works. Each change raises the revision, so use the new ETag for the next one.
Run input, failed runs, and automatic pauses
Run input, failed runs, and automatic pauses
payload is optional and can be any JSON value up to 64 KiB (65,536 bytes) as JSON; a larger one is refused with 400 on payload.A run that couldn’t start a session ends failed with an error that has a code, a message, the field or resourceId responsible when there is one, and retryable.Resume is refused with 422 automation_reference_invalid while the automation’s environment is deleted, or while it names an agent or agent version that no longer exists; the automation stays paused. If a run fails because something the automation uses no longer exists, such as its agent, environment, a vault, a credential, or a file, the automation is paused, and the run’s error says what is gone. Fix the automation, then resume it.See run history
In Automations, choose View runs from the automation row’s Actions menu. Each run shows its Trigger, when it started, and Session creation. Filter by status, trigger, or date, and click a run for its Run detail and a link to its session. In the API, list an automation’s runs, then read one.getAutomationRun returns one run with its frozen snapshots and effectiveInitialMessage.
Run filters and paging
Run filters and paging
listAutomationRuns returns runs newest first. Filter with automationId, triggerId, eventSourceId, triggerType, status, createdAtGte, and createdAtLt, and page with limit and cursor.Get a run’s result
A run’sstatus says only whether its session started. Its result says how the work ended: whether it is still going, and once it is finished, a verdict with a reason, the graded outcome, the structured JSON result, the agent’s last message, and the files the session saved. One request can wait for it, so you don’t need to follow the session yourself.
A run of a Slack trigger that continues a thread, or answers a DM, shares its session with the thread’s other runs, so its result would show whichever run spoke last. Reading it is refused with 422 automation_run_session_shared, even while the run is pending; read the session instead. Every other run starts its own session and has a result.
Reading a result needs read access, which every organization role with Managed Agents access has. Pass waitSeconds, up to 20, to hold the request until the run finishes or the time is up:
state is pending or running, with run and, once there is one, session. Repeat the request until state is finished, since a busy organization’s request can answer before the time is up. A finished run answers at once:
verdict, and show reasonMessage to people. reason is a stable code for your own branching.
passed as success, and completed too when the automation has no outcome. Treat every other verdict as not done.
Every state and reason
Every state and reason
running again when its session continues. Someone can continue it, for example by replying to a session that stopped for review, raising its budget, or sending a completed session another message. Some sessions also continue on their own: a browser hand-off (awaiting_human) when its deadline passes, and a session paused for credit once credits are bought.verdict, and treat a reason you don’t know as information.Outcome, output, final message, and session
Outcome, output, final message, and session
state is finished.outcomeis the session’s newest outcome, when it was graded:status,terminalResult(satisfied,max_iterations_reached,not_applicable,not_evaluable, orfailed),explanation,iterations(the grading passes that reached a verdict), andcriteriafrom the last pass, in rubric order. Each criterion hascriterionId, itstext, averdictofpass,fail, ornot_applicable, an optionalrationale, and itscriterionKeywhen the rubric names it.outputis the structured result.sourceisfilefor a declared result file, with itspathandfileId, orfinal_messagewhen it came from the agent’s last message.validsays whether it is a single JSON value other thannull; when it is,jsonholds it with numbers exactly as written. When it isn’t,errorsays why, andtruncatedistruefor a file larger than the 1 MiB that is read. A result file that has expired reads asvalid: false.finalMessageis the text of the agent’s last message, cut at 64 KiB without splitting a character, withtruncatedsaying whether it was cut.eventIdnames the session event that holds all of it.sessionis a summary:status,executionState,stopReason,failure,costUsd(the billed cost as a decimal string, absent when it can’t be read),createdAt, andlastActivityAt. Read the session for everything else.
Download the files a run saved
artifacts lists every file the run’s session saved as a deliverable, including files its subagents and teammates saved, sorted by path. It is empty until the run is finished. Download a file by its fileId:
fileId, path under the deliverables folder, filename, mediaType, byteSize, createdAt, downloadable, and sha256 when it is known, so you can check a download. Download only entries with downloadable set to true. The list holds at most 100 files; when the session saved more, artifactsTruncated is true, and listing the session’s files returns all of them.
Run an automation from CI
A CI job can start a run, wait for its result, and pass or fail on the verdict, with onlycurl and jq. Create the automation first, with an outcome when “it finished” isn’t enough and a result file when the job reads a value.
Create a key for the job
Store the key as a secret
RECURSION_API_KEY, and expose it to the job as the RECURSION_API_KEY environment variable. Never print it, commit it, or put it in the automation’s prompt.Plan for expiry
0 only for passed or completed:
- Idempotency-Key.
runAutomationrequires one. A key made from the CI run and attempt numbers makes a retried request return the same run, while a re-run of the job starts a new one. The script uses GitHub Actions’GITHUB_RUN_ID,GITHUB_RUN_ATTEMPT, andGITHUB_SHA; in another CI system, use its equivalents. - Waiting. Each result request waits up to 20 seconds and answers as soon as the run finishes, so the loop makes about three requests a minute. A busy organization’s request can answer at once, so the loop pauses 2 seconds before asking again.
--retryrepeats a request after a timeout,429, or a5xxanswer; both requests are safe to repeat. - Requiring a grade. If the job must not pass ungraded work, accept only
passed.
Run it in GitHub Actions
This workflow runs the automation on every pull request opened from a branch of the repository, writes the verdict to the job summary, and fails the check unless the run passed or completed. Save it as.github/workflows/agent-check.yml, and add the key as a repository secret named RECURSION_API_KEY. GitHub passes the secret to the step as an environment variable and masks it in the logs.
GitHub gives no repository secrets to pull requests from forks or to runs started by Dependabot, so the job skips those instead of failing on an empty key. Don’t switch to pull_request_target to get around this: it runs with your secrets on code nobody has reviewed yet.
listAutomationRuns, as in See run history, and wait on its result the same way.
Change or delete an automation
Saving a change keeps the automation’s current status. Deleting it removes its triggers while preserving records for runs that already started.- Console
- cURL
If someone else saved first
If someone else saved first
Keep the agent version current
An automation keeps the agent version it was saved with. Later changes to the agent’s instructions, tools, and integrations don’t apply to its runs until you move it to the new version. In the Automations list, an Older version label marks automations that run an older version than their agent’s latest. When you open one, the drawer names both versions, for example “This automation runs Version 1 of backend-fixer. The agent is now on Version 2”, and offers Use Version 2. Click it, then Save changes. In the API, replace the automation with the newagentVersionId. Moving an automation doesn’t move sessions it already started; move those sessions themselves.
Receive events
An event source is an endpoint that receives events and checks they’re genuine. Automations listen to it through Slack, GitHub, and webhook triggers. One source can serve many automations, up to the enabled-trigger limit in Limits.Signing secrets and disconnecting
Signing secrets and disconnecting
Manage sources
In Automations, open the Event sources tab. Each source’s health and last delivery are columns in the list, and its row’s Actions menu pauses or resumes deliveries. A healthy source has received a delivery, which does not prove the provider can reach it right now. A connection-managed source is changed and removed through its connection on Integrations. A custom source can be deleted when no automation has a trigger on it. A switched-off trigger still holds its source, although the list’s Triggers column counts only the ones that are on. A refused delete names the automations: the console lists them, and the409 conflict response carries them in details.dependents.
Source health
Source health
Manage sources with the API
Manage sources with the API
listEventSources and getEventSource return sources, and getEventSourceStatus returns health, triggerCount, and lastDelivery. Pause and resume need If-Match with the source’s ETag. Set EVENT_SOURCE_ETAG to the complete header returned by getEventSource.Send a custom webhook delivery
A custom source receives deliveries at its Callback URL, shown in Event sources. The full URL is the console’s address followed by the callback path,https://recursion.labelbox.com/agents/v1/event-sources/<eventSourceId>/events. Give it to the sender, and resume the source when you’re ready to receive events.
Send a JSON body with POST to the callback URL. For an hmac_sha256 source, compute the HMAC-SHA256 of the exact body bytes, keyed with the source’s signing secret, and send it as lowercase hexadecimal in the signature header, after the prefix. Sign the bytes you send; re-serializing the JSON after signing breaks the signature.
200 with {"ok": true}, and matching triggers on active automations start runs. The same signed body is treated as the same delivery, so a retry doesn’t start a second run. For an unsigned source, send an X-Webhook-Id or Idempotency-Key header to name the delivery. To route deliveries by kind, send an X-Managed-Agents-Event-Type header of up to 256 bytes and filter on it with eventTypes.
Sign a timestamp to reject replays
Sign a timestamp to reject replays
hmac_sha256_v2 source signs ordered parts instead of only the body, so it can match a sender that signs a timestamp with the body. List up to 8 parts in signedParts, in the order the sender joins them, with no separator added between them:replayWindow to reject old deliveries. Its header carries the send time in whole Unix seconds, such as 1790000000, and must also be a signed header part. A delivery whose timestamp is missing, isn’t digits only, or is more than maximumAgeSeconds (1 to 3600) before or after its arrival fails with 401 unauthorized, so a captured delivery can’t be replayed later. This verification policy matches Slack’s v0:{timestamp}:{body} signature:{timestamp}.{body} signature, sign the timestamp header, the literal ., then the body. The signature is still lowercase or uppercase hexadecimal after the prefix; base64 signatures and headers that carry several signatures aren’t supported. Headers that the platform adds or removes on the way in, credentials such as Authorization, and the signature header itself can’t be signed. An hmac_sha256 source keeps signing only the body. The console shows an hmac_sha256_v2 source read-only, so create and change one with createEventSource and replaceEventSource.Every delivery response
Every delivery response
How automations run
- Every run uses the pinned agent version. Publishing a new agent version doesn’t change the automation. See Keep the agent version current.
- Run inputs are frozen, with two live automation-definition checks. A run records the automation, trigger, event and opening message as they were at admission. The coordinator settings are read when a run is delivered, using defaults for those settings if the automation was deleted. Separately, a report comment electing a fresh investigation checks that the automation still exists and names its admitted agent; otherwise that run fails. Existing investigation joins, inherited-mode successors and retries of an already-elected start retain their snapshot.
- The opening message is your saved prompt. For an event run, it’s followed by
Event for this run:and the event as JSON. For a manual run with input, it’s followed byInput for this run:and the input. For a scheduled run, it’s followed byThis is a scheduled run for <time>., where the time is the occurrence in UTC, such as2026-10-01T08:00:00Z. When the automation declares a result file, the message ends with the sentence that asks for it. - The verdict comes from the session. A run’s
statusstops atcreated; its result follows the session to a verdict. - Sessions show where they came from. A session an automation started shows Started by in its session panel: the automation, the trigger (Manual, Schedule, Slack, GitHub, or Webhook), and the run, each linked.
What can go wrong
The most common problems:- A run is
failed. The session couldn’t start. Read the run’serror. Ifretryableistrue, run it again; otherwise fix the namedfieldor resource. - An automation paused on its own. A run found that something it uses was deleted. Read the failed run’s
error, fix the automation, then resume it. - An event starts no runs. Check the source status and the trigger filters. Edited or deleted Slack messages never start runs.
- Runs still use access you removed from the agent. The automation runs its pinned agent version. Move it to the new version. See Keep the agent version current.
- A run’s result reads
errorwithoutput_missing. The agent didn’t save the declared result file. Name what the result should contain in the prompt, and readfinalMessageto see what the agent did instead.
Every automation error
Every automation error
Limits
Limits on triggers, prompts, names, run input, run defaults, run results, schedules, trigger filters, and custom webhook bodies are in Limits. Three more apply here:- A page of automations or event sources holds 1 to 100 items, 50 by default.
- A result request waits at most 20 seconds. Its
artifactslist holds at most 100 files, itsfinalMessageat most 64 KiB, and at most 1 MiB of a declared result file is read. - Name and prompt limits count UTF-8 bytes, not characters: an emoji or a non-Latin letter takes 2 to 4 bytes, so a name in those scripts fits fewer than 256 characters.