Skip to main content
This example receives a generic event and stores a record for one day. It does not send messages or call an external business API.

1. Create a draft

Open Automations in your workspace, create an automation, and give it a name such as Record an event. Add a webhook section. You can also create the draft with create_automation and set its definition with update_automation through MCP.

2. Configure the section

Use this complete definition in an MCP update, or create the equivalent blocks in the editor:
The first step creates steps:prepare. The second maps that whole object into input.value. namespace is fixed; key is rendered from the prepared event ID.

3. Test before activation

Select record_event and use this sample payload:
Check that the entry conditions match, prepare returns the expected object, and save reports a simulated write. The test does not persist this KV value. Also test a missing ID: the transform should fail and the write should not execute.
Test mode is not a universal offline mode. This example only transforms data and simulates a write. Other blocks can perform real reads or model calls. Review the test-mode matrix before testing a different flow.

4. Activate and send one controlled event

After reviewing the definition, activate it and copy its webhook URL from the Portal. Keep this URL private: its token grants access to that entry point.
Admission returns HTTP 202 for an accepted request. That means the request was admitted, not that all steps have finished. Open the run history, inspect both steps, and verify the KV record through the workspace’s data tools. Reusing an idempotency key refers to the same logical request during its deduplication window. Generate a new key for a genuinely new operation, not merely because a response timed out.

5. Extend the flow

  • Add an If block to branch on a record’s attributes.
  • Add Connector or HTTP to update another system.
  • Add Send message when the destination, connection, template, and messaging eligibility have been validated.
  • Bind an existing trigger if callers must keep their URL. Start with a narrow event condition; see routing.