Start a Claude routine
Use community events to start a Claude Code cloud task without hosting a service.
A Claude routine can welcome members, investigate tagged conversations, or prepare briefings when someone enters a segment. Datum sends an event notice. Claude uses your Datum connector to get details and complete your chosen work.
Connect Datum to Claude
The routine uses Datum’s connector to read and change your community.
- Open claude.ai/customize/connectors.
- Add a custom connector with your workspace’s MCP address,
https://app.ocmgr.com/mcp/<workspace id>. - Sign in to Datum when Claude requests it.
- Select the required access on the consent page.
Datum shows the address in Settings → Access. See Connect an agent.
| Scope | What the routine can do |
|---|---|
| Read | Get the event with get_event_context. Read community data with explore and other read tools. |
| Write | Also tag members and add notes. |
| Admin | Also post member cards to Slack with send_member_card. |
Grant only the access the routine needs. A routine that prepares briefings needs read access.
Set up Claude
Create the routine with an API trigger
Open claude.ai/code/routines. Create a routine. Choose an API trigger.
Copy the token now
Saving the trigger opens the API token dialog. Claude shows the token only once. You cannot retrieve it later.
Copy the token immediately. Use this token for Datum.
A Claude Platform API key does not work here.
Choose Regenerate in the same panel if you lose the token. Paste the new token into Datum.
Regeneration stops the old token from working.
Write a prompt that acts on the event
Describe the work in the routine’s prompt. Tell the routine to act on the event.
Claude puts Datum’s notice in an untrusted
<routine-fire-payload>block. The routine ignores this block unless its saved prompt specifies its use. Someone with the token can send text but cannot give the routine new instructions. See Claude’s routines guide.Start the prompt with this text:
Act on the Datum event in the routine-fire-payload block. Use the Datum connector's get_event_context with its event id for details, and pass that event id as event_id on any Datum action.Add the work that the routine must perform.
The notice contains the event ID in
data.event_id. Datum’s write tools, includingadd_noteandsend_member_card, use this ID to prevent duplicate actions. See Pass the event id to Datum’s actions.Keep the Datum connector included
Keep your Datum connector in the routine’s Connectors tab. Remove connectors that the routine does not need.
Find the Fire URL
The token dialog does not show the Fire URL.
Open the routine at claude.ai/code/routines. Open the menu beside its name. Choose Edit. Click Instructions in the edit dialog. Copy the Fire URL.
The URL has the format
https://api.anthropic.com/v1/claude_code/routines/trig_…/fire. Datum accepts only this format.
Claude’s routines guide describes the current creation dialog and connector controls.
Add it to Datum
- Open Settings → Destinations → Add destination → Claude routine.
- Paste the Fire URL into Fire URL. The form says so at once if the address isn’t a Fire URL.
- Paste the token into Token.
- Choose the events that start a run.
- Apply filters for a specific segment, source, or tag if necessary.
- Enter optional Instructions for this destination.
- Review the matching events in the last 7 days count.
- Choose Create routine.
- Open the destination.
- Choose Send test.
- Refresh the delivery history.
- Choose Open run.
- Check that Claude can access Datum.
- Read the session to verify the routine’s actions.
Your routine also appears in Settings → Routing → Agent rules. Owners can add, edit, enable, or disable routines there with the same editor. Members can view routines without changing them. Choose Delivery history → to open the routine in Destinations.
To create a routine for manual sends, select Only when a teammate sends someone (no automatic events) in the form. Choose Create routine. It shows On demand only in Routing and appears in Send to…. Automatic events never start this routine. Choose Edit in Routing to change its instructions or select automatic topics.
Datum adds optional Instructions before each notice. These instructions let one routine serve multiple destinations. Keep sensitive information out of instructions.
High volume means more than 1,000 matches. A successful delivery confirms that Claude started the run. It does not confirm that the routine completed its work.
Datum sends a summary, time, and event ID. It includes a member’s name only when you enable personal data. It never copies email addresses or message text into the notice.
Datum never shows the token again. Edit the destination to replace it.
A running Datum worker sends notices directly. These notices do not use the separate delivery service or portal. Help beside each field opens on hover or keyboard focus.
Send one member or organization by hand
A routine you set up for events can also take one person, one person with an activity, or one organization when you choose. 1. Open the member or the organization. 2. Choose Send to…. 3. Choose Agent. 4. Select the routine.
On the Activity screen, use Route… and then Agent. Datum starts the run immediately. When Claude returns a session link, Datum shows Open run.
A hand-sent notice has a member_id or an organisation_id and no event ID. Tell the routine what to do in both cases. For example:
If the payload has a member_id instead of an event id, fetch that member with get_member and follow the teammate's note.
If it has an organisation_id, fetch that organization with get_organisation and follow the teammate's note.
See Send to an agent for what the notice contains, where your note goes, and the limits.
Usage and repeated runs
Each event and test starts a cloud run against the routine owner’s Claude plan. The seven-day count estimates volume from recent events. It does not forecast future volume or limit spending.
Datum does not rate-limit this destination. Claude’s usage limits still apply. Routines remain a research preview, so behavior and limits can change. See Claude API and usage reference.
Repeated sweeps and replays use one delivery record. A lost HTTP response or manual retry can start another session because Claude’s trigger has no idempotency key.
Pass data.event_id to Datum write tools to help prevent duplicate actions.
Review the saved prompt before enabling actions that contact people or modify other tools.
Choose Disable to stop delivery. Choose Archive destination to archive the destination while preserving its history.
Regenerating the API token in Claude revokes the previous token. Paste the replacement into Datum before sending another test.
Self-host operators need a running core worker. The 20 October 2026 check against Anthropic’s fire reference confirmed the API contract. It uses a trig_ URL, bearer authentication, version 2023-06-01, {text}, and a session URL.
Claude accepts the optional beta header. A 200 response confirms that Claude created a session. It does not confirm task completion.
When a delivery fails
History shows the last delivery, failure reason, next retry time, and successful session links. Datum retries temporary failures, including 429 responses, server errors, and network errors. The wait increases from 30 seconds to one hour, or longer when Claude requests it. Delivery stops after eight failed attempts.
A rejected or revoked token returns 401 and stops that delivery immediately.
- Generate a replacement token in Claude.
- Edit the destination.
- Save the replacement token.
- Choose Retry for the failed delivery.
For a 403 response, check the token. Check the account or organization permissions.
A 404 response means the trigger does not exist. A 400 response means Claude rejected its settings. Datum does not retry successful deliveries.
Check Claude for a session before retrying a delivery with an unknown outcome. Use event IDs for Datum write actions.
A lost network response can still cause another run. Datum keeps completed history for 30 days without the notice text. Datum skips events for people erased before delivery. Datum cannot recall a run that Claude already started.