Starting automations
An event can start an automation instead of a single agent. That lets one event run several steps: check a condition, ask two agents side by side, wait for your approval, then summarise.
1. Set the automation to start from events
Section titled “1. Set the automation to start from events”- Open Automations and create or open an automation.
- Under What starts it, choose An incoming event.
- Optionally paste a sample event (like
{"title": "Car arriving", "data": {"plate": "ABC123"}}), so Try live has something to work with. - Write the steps. Use
{{trigger}}wherever a step needs the event. - Press Save & enable. A paused automation refuses events.
2. Send the event
Section titled “2. Send the event”Name the automation in workflow:
curl -X POST http://127.0.0.1:47800/api/events \ -H "Authorization: Bearer hive_…" \ -H "Content-Type: application/json" \ -d '{"workflow": "Car arrives", "title": "Car arriving", "data": {"plate": "ABC123", "camera": "driveway"}}'Send workflow or agent and prompt, not both.
What the first step gets
Section titled “What the first step gets”The event’s title, message and data are passed to the first step as {{trigger}}, inside <event> tags. Steps are told to treat it as information, not instructions.
For example, a step might say:
A camera saw a car: {{trigger}}ABC123 is Sarah and XYZ789 is the plumber. Say who it is in one sentence.As with any automation, the result is posted to Activity unless you untick Post the result to Activity, and each run is kept in its Run history.
Errors
Section titled “Errors”error |
Fix |
|---|---|
There's no workflow called '…'. |
Check the name matches the automation exactly. |
That workflow doesn't start from events. Set its trigger to an incoming event. |
Change What starts it to An incoming event. |
That workflow is paused. |
Press Save & enable or Resume. |
