Onboarding Agent
Closed won: Northwind Logistics
Event from Salesforce via Tray workflow · 16:40
- Trigger
- Opportunity stage changed to Closed Won
- Proposed project
- Onboarding, Enterprise template, CSM: Ana Silva
- Proposed kickoff
- Tuesday 10:00, invite to 4 contacts
- Tool waiting
- create_onboarding_project, needs approval
Agent run
- 16:40 Workflow called the agent route with the deal Tray workflow
- 16:40 Read the deal, contacts and products Agent
- 16:41 Paused: create_onboarding_project needs approval Agent
What matters here
- A Tray Helix agent can start from a webhook or app route, from any app event through a Tray workflow trigger, or on a schedule.
- An event-triggered agent calls the same API route as every other caller, with a named Helix API token you can revoke.
- A Tray workflow trigger lets an agent react to events in any app Tray connects to, not only the ones with webhooks.
- Writes still wait for approval, so an agent that starts on its own still asks before it changes anything.
- Each run is logged under the event that started it, so you can trace any action back to its cause.
Who this is for
You have an agent, or a job for one, that should start when something happens in another system. You don't want a person to notice the event and press a button.
How it works in practice
From an event in another system to a proposal waiting for a person.
- 1
Something happens
A deal closes, a ticket is created, an alert fires or a date arrives.
- 2
The agent is woken
A webhook calls the app's route, a Tray workflow trigger calls it for any app event, or a scheduled function runs.
- 3
It reads what it needs
The event carries the ID, and the agent's read tools fetch the rest.
- 4
It proposes the work
Writes are tools marked for approval, so the run pauses and the owner gets a notice.
- 5
A person approves
The run picks up where it left off and does the work.
What an event-triggered agent is made of
A route, the triggers that call it, and the agent you already have.
An event route
An API route on the app that takes an event type and an ID, and starts the agent. Called with a Helix API token.
Triggers
Webhooks from systems that can send them, Tray workflow triggers for any app event, and scheduled functions.
The agent
Read tools run on their own. Write tools are marked for approval.
An event log
Each event, the run it started and the outcome, so nothing fires twice unnoticed.
The prompts
Paste these into Claude Code, Codex or Cursor in order. Each one leaves you with something that runs, so you can stop after any step.
These prompts start from a Helix project, which is what handles sign-in, credentials and hosting. Start with Helix.
An event route
One door for every trigger.
In my Helix app, add an API route that starts the agent from an event.
It takes an event type and a record ID. Store each event with when it arrived, its source, and the run it started. Ignore an event with the same type and ID that arrived in the last ten minutes, so a retry does not start a second run.
Then run the agent and return the run ID with its status: done, or waiting for approval.
The onboarding agent
What to do when a deal closes.
Add an agent that prepares customer onboarding when a deal closes.
Give it these tools:
- get_deal: read the opportunity, its products and contacts.
- pick_template: choose the onboarding template for the products sold.
- create_onboarding_project: create the project and its tasks.
- propose_kickoff: draft a kickoff invite. It must not send anything.
Mark create_onboarding_project as needing approval every time. When a proposal is waiting, post the customer success owner in Slack with a link.
Add a schedule
For work that runs on a timetable.
Add a scheduled function that runs every weekday at 8:00. It finds onboarding projects with a kickoff date in the next two days and no confirmed time, and runs the agent to propose a time.
Connect it to real systems
Your events, your tools.
Now connect it to the systems we actually run.
Anything in angle brackets is a placeholder. Swap it for whatever we use.
<Salesforce>. A Tray workflow triggers when an opportunity moves to Closed Won and calls this app's event route with a Helix API token.
<Asana>. Create the onboarding project after approval.
<Slack>. Post waiting proposals to the owner.
Only write through create_onboarding_project.
Ship it
A URL, and the triggers pointed at it.
Deploy my app.
What it connects to
Three ways in, one agent.
-
Salesforce Fire a Tray workflow trigger when an opportunity closes. Reads
- PagerDuty Send a webhook to the app's route with a Helix API token. Reads
-
Asana Create the onboarding project after approval. Writes
-
Slack Tell the owner a proposal is waiting. Writes
Named systems are the ones most teams actually run, not a list of the only ones that work. Swap in whatever you use.
Running it for real
The build gets you an agent that starts itself. Running it means every caller is named, writes still wait, and each run traces to its event.
- 1
Deploy the app and its agent together
One command, or Deploy from CI on every merge, takes the app to a live URL. The agent ships with its app, so you can roll back any deployment.
- 2
A named token for each trigger
Each caller uses a Helix API token: a named API user you can revoke, with every call logged.
- 3
Approval, even unattended
An agent that starts on its own still pauses before any write, and the approver sees the tool and the exact input.
- 4
Every run traced to its event
Runs are logged under the event that started them, and Tray streams the logs to your SIEM.
- 5
Know what events cost
AI usage shows per app, so a noisy trigger shows up as cost before it shows up as a problem.