Skip to main content
In this guide, you will build an automation that receives an HTTP request and emails your organization members.

Create a project

Create an empty directory, sign in, and initialize an Automate.ax project:
Select or create a project when prompted. The command installs automate.ax, creates automate.config.ts, and adds an example at automations/example.automation.ts.

Write the automation

Replace the example with this program:
automations/example.automation.ts
This file contains the three parts of an automation:
  • automation defines the program and its description.
  • onHttpRequest declares the trigger that starts a run.
  • sendEmail declares the action that performs work.
The trigger returns a signal, a typed reference to data that will exist when a request arrives. The t template preserves the signal dependency inside the email body, so the action waits for the request data before it runs. Keep side effects inside actions. The automation callback composes durable work synchronously, so do not await triggers or actions.

Deploy the project

Deploy every *.automation.ts file beneath automate.config.ts:
The CLI plans the automation, publishes the project, and prints the URL for the HTTP trigger. It also records deployment details in .automate/deployment.md.

Invoke the automation

Send a request to the deployed trigger URL:
The endpoint accepts the work immediately, and the automation emails every member of the project’s organization with the request method and path.

Continue building