Skip to main content
An automation is a TypeScript program exported from a *.automation.ts file. Its description identifies the program during deployment and execution.
automations/archive-receipts.automation.ts
The default export must be the value returned by automation(description, fn). The callback defines the triggers, actions, signals, and dependencies that make up the automation.

Automation code is direct TypeScript

Automate.ax does not compile your program into a user-authored JSON graph. You can organize repeated logic with ordinary functions and modules:
Calling the helper registers both actions. Because neither action consumes the other’s result, they can execute independently once messageId materializes.

Compose synchronously

The automation callback runs synchronously to describe durable work. Actions do not return promises; they return signals for eventual outputs.
Do not await an action. Passing message.subject into log records the dependency and allows Automate.ax to execute log after getMessage succeeds.

Keep composition deterministic

Automate.ax replays automation code while planning and resuming durable work. The same inputs must produce the same action and trigger call structure.
  • Keep action and trigger calls in stable positions.
  • Use signals for decisions based on event data or action results.
  • Do not choose which durable calls exist using ambient time, randomness, or process-local mutable state.
  • Put side effects in actions, not directly in the automation callback.
Use signal-aware control flow such as filter or branch when execution should depend on runtime data. See Signals.

Projects and files

automate init creates an automate.config.ts file that identifies the project. automate deploy discovers every *.automation.ts file beneath that configuration directory and deploys them together. The relative source path is the automation’s stable identity within the project. Renaming or moving the file removes the old identity and creates a new one on the next deployment.