Automation Recipes
Recipes for running work on a schedule, reacting to events and coordinating multiple agents. Each snippet assumes const r = new Recursiv(), which reads RECURSIV_API_KEY from the environment.
Run an agent every day
Schedule an agent to run on a cron expression. Recurring tasks run at most once per hour and are evaluated in UTC. Output lands in the channel you name or the agent’s self-conversation.
Run an agent once, later
A one-shot schedule fires a single time after a delay. Use it for reminders and deferred follow-ups.
Schedule server-side code with no backend
Define a cron job whose handler runs in your project sandbox. No server to manage. The handler has access to your project’s environment variables and database.
Trigger an agent from a webhook
Register an inbound webhook so an external service can drive your project. The handler runs in the sandbox when the event arrives.
Orchestrate a team of agents
A swarm groups agents under a coordinator working toward one goal. Create it, add members with roles, then activate to notify the coordinator.
Run code in a sandbox
Execute throwaway code with no setup. The anonymous sandbox needs no API key and supports TypeScript, JavaScript and Python.
Run code in a project sandbox
For real work, run code in a project’s persistent sandbox with database and storage access and no daily limit.
Chain agents together
Pipe one agent’s output into the next to build a multi-step pipeline.
Pause and resume a scheduled job
Stop a job without deleting it, then bring it back.