Goal of this module
Make TaskFlow react to its own data. You'll attach an automation so that every new task posts a Slack message — no polling, no extra code in your write path.
What an automation is
An automation runs when a record changes. As an org admin you attach one to an entity's lifecycle event in API Studio; it then fires for every workspace in your org whenever a matching write happens. Automations are driven by change data capture, so they run asynchronously — your create call stays fast.
1 · Make sure a Slack connector exists
Notification destinations like Slack are connectors registered at the platform level. Confirm a Slack connector is available (or use notification.email instead, which needs no connector setup) before defining the event.
2 · Define the automation
Pick the entity (task), the operation (create), the stage (after), an event type, and a destination config. {{source.field}} references the record that triggered the event.
POST /api/event
{
"entity_name": "task",
"event_name": "task-created-notify-slack",
"event_type": "notification.slack",
"event_stage": "after",
"event_optype": "create",
"enabled": true,
"destination_config": {
"channel": "#taskflow",
"text": "New task: *{{source.title}}* (priority {{source.priority}})"
}
} {{source.*}} is the changed record
In a destination config, {{source.field}} references the entity record that triggered the event. The mapping is resolved to concrete values before the handler runs.
Event types you can choose
- notification.slack / .email / .sms / .teams — send a message.
- external.connector — call a registered third-party connector action.
- external.webhook — POST to a URL you specify directly.
- external.s3 — write an object to the tenant's S3 bucket.
- app.entity — write to another entity within the platform.
3 · How it flows
task + create.{{source.*}}.Combine with Module 6
Because the automation reads {{source.priority}}, run your triage-task crew first so priority is set — or set the priority at create time — and the Slack message will carry it. Events can also fire crews: a run_crew logic block can itself be triggered by an entity write.
Before-events gate the write
After-events (used here) run asynchronously once a write succeeds. A blocking before-event runs synchronously and can reject a create with 424 — use it for validation that must gate the write.
Try it
Define the task-created-notify-slack event, then create a task. Watch the message land in your Slack channel within a second or two — with the task title and priority interpolated from the record.