Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
routines
What it is
Part of the agent sessions feature. Validated routine (scheduled-action) commands and AI tools for agents to schedule themselves or another persona/model to run later.
Start here
src/domain.rs:RoutineConfiguration— name,triggers(RoutineTrigger:Once,Cronor activityEvents) andsteps(aroutine_programprogram, sent as a JSON string) — the validated command shape.deserialize_configurationstill accepts the old single-agent input (instructions,target,schedule) and turns it into one agent step.src/inbound.rs: the AI toolset exposed to MCP and embedded agents.src/create_routine.md:CreateRoutine's description — triggers, the two step types (code and Ask AI) and a worked example, which a test parses and the harness's real-Deno test type-checks. Its code-step section isroutine_program'scode_steps.md, appended at compile time and shared with the scheduler's drafter; edit it there.CreateRoutinetells agents to usem-document-mentionwith the routine ID, name, andblockName: "routine"in replies.src/outbound.rs: the HTTP client to the owning scheduled-action service.
Scope
- Owns: routine command validation and the agent-facing tools to create/manage them.
- Not here: the cron engine and durable schedule storage, owned by the
scheduled-action service this crate's
outboundcalls into.
Boundaries
- Depends on:
ai_toolset,macro_authorization,macro_user_id,routine_program(the step model and its validation). - Used by:
ai_tools.
Recipes
- Add a routine tool:
src/domain.rs(command/schema) →src/outbound.rs(HTTP call) →src/inbound.rs(tool registration).
Checks
cargo test -p routines(SQLX_OFFLINEunset).
Related
- Skill:
create-ai-tool· Rules:.agents/rules/rust/architecture.md