Skip to content

MngAddAIWorkflowBinding

POST ai/workflow/binding

Creates a binding: this event, this agent, this template, these channels — plus the rules that decide when a message is allowed at all.

Access Control

Allowed: admin. The agent must have modeWorkflow enabled, and the event must be agreed.

Parameters

Parameter Type Description
eventName string Event from MngGetAIWorkflowEvents
agentId int Agent allowed in workflow mode
promptTemplateId int Template of type notification
enabled bool Default true
cooldownSeconds int Minimum pause between messages to one recipient, 0 to 604800
deduplicationWindowSec int Window in which the same event is considered a repeat
delivery array notify, email, sms, manager
settings object Filters and limits, see below

settings accepts:

Key Meaning
filters { field, op, value } with eq, ne, in, notIn, gt, gte, lt, lte
quietHours { start, end }, hours 0–23, service time (UTC)
maxPerRecipientPerDay Cap for this binding
requireApproval Whether a person approves before delivery
fallbackText Ready text used when the model is unavailable

A filter field is validated against the event variables, so a typo is refused instead of silently disabling the rule.

Response Data

The created binding, in the shape returned by MngGetAIWorkflowBindingsByFilter.

Errors

Code Error Description
400 AI_INVALID_DATA Unknown event, an event without an agreed contract, an unknown filter field or delivery channel
400 AI_INVALID_DATA The agent is not allowed in workflow mode
403 AI_ACCESS_DENIED The session is not an administrator
404 AI_AGENT_NOT_FOUND No such agent in this brand