Notifications alert you when workflows complete, fail, or detect data changes. You can receive them via email, webhooks, or WebSockets. The SDK handles channel management automatically.
Prerequisites
Kadoa account with API key
SDK installed: npm install @kadoa/node-sdk or uv add kadoa-sdk
Quick Start
Node SDK
Python SDK
MCP Server
import { KadoaClient } from "@kadoa/node-sdk" ;
const client = new KadoaClient ({ apiKey: "YOUR_API_KEY" });
await client . notification . setupForWorkflow ({
workflowId: "YOUR_WORKFLOW_ID" ,
events: [ "workflow_data_change" ],
channels: {
WEBHOOK: {
name: "my-webhook" ,
webhookUrl: "https://your-server.com/webhook" ,
httpMethod: "POST" ,
},
},
});
The SDK reuses existing channels with the same name. Running setup multiple times won’t create duplicates.
Channel Types
Email
// Use account email
await client . notification . setupForWorkflow ({
workflowId: workflowId ,
events: [ "workflow_finished" , "workflow_failed" ],
channels: { EMAIL: true },
});
// Or specify recipients
await client . notification . setupForWorkflow ({
workflowId: workflowId ,
events: [ "workflow_finished" ],
channels: {
EMAIL: {
name: "team-notifications" ,
recipients: [ "team@example.com" ],
},
},
});
Slack
await client . notification . setupForWorkflow ({
workflowId: workflowId ,
events: [ "workflow_failed" ],
channels: {
SLACK: {
name: "team-notifications" ,
slackChannelId: "C1234567890" ,
slackChannelName: "alerts" ,
webhookUrl: "https://hooks.slack.com/services/YOUR/WEBHOOK" ,
},
},
});
Webhook
await client . notification . setupForWorkflow ({
workflowId: workflowId ,
events: [ "workflow_data_change" , "workflow_finished" ],
channels: {
WEBHOOK: {
name: "api-integration" ,
webhookUrl: "https://api.example.com/webhooks/kadoa" ,
httpMethod: "POST" ,
},
},
});
WebSocket
Receive events in real-time
For reconnect, drain, and reliability semantics, see WebSockets .
const client = new KadoaClient ({ apiKey });
const realtime = await client . connectRealtime ();
// Subscribe to all events
realtime . onEvent (( event ) => {
console . log ( "Event received:" , event . eventType , event . message );
});
// Filter events by type
realtime . onEvent (( event ) => {
if ( event . eventType === "workflow_finished" ) {
console . log ( "Workflow completed:" , event . message );
}
});
// Handle errors
realtime . onError (( error ) => {
console . error ( "WebSocket error:" , error );
});
realtime . close ();
Subscribe to All Events
await client . notification . setupForWorkflow ({
workflowId: workflowId ,
events: "all" ,
channels: { EMAIL: true },
});
Reusing Channels
Reference existing channels by ID
// List channels
const channels = await client . notification . channels . listChannels ({});
const webhookChannel = channels . find ( c => c . name === "my-webhook" );
await client . notification . setupForWorkflow ({
workflowId: newWorkflowId ,
events: [ "workflow_data_change" ],
channels: {
WEBHOOK: { channelId: webhookChannel . id },
},
});
Template-Managed Notifications
When a workflow is linked to a template that includes notifications, the notification settings are managed through the template. Attempting to modify notifications on a template-linked workflow returns a 409 error. Unlink the workflow first, or update the template and apply the change.
Setup Notifications via API
Step 1: Create Notification Channels
First, create the channels you want to use for notifications. See Email , Webhooks and WebSockets for channel creation examples.
Step 2: Subscribe to Events
Subscribe to events by sending a POST request to /v5/notifications/settings.
Workspace-Level Subscription
Apply notifications to all workflows:
// POST /v5/notifications/settings
{
"eventType" : "workflow_finished" ,
"eventConfiguration" : {},
"enabled" : true ,
"channelIds" : [ "<channel-id>" ]
}
Workflow-Level Subscription
Apply notifications to a specific workflow:
// POST /v5/notifications/settings
{
"workflowId" : "<YOUR_WORKFLOW_ID>" ,
"eventType" : "workflow_data_change" ,
"eventConfiguration" : {},
"enabled" : true ,
"channelIds" : [ "<channel-id>" ]
}
Step 3: Update Existing Settings
To add more channels to existing settings, use a PUT request:
// PUT /v5/notifications/settings/<settings-id>
{
"channelIds" : [ "existing-channel-id" , "new-channel-id" ]
}