Messages from automations
Let a workflow send a Cortex message to a person, a workspace channel or a workspace's General. Cortex posts it.
A workflow can tell people what it did. The Cortex block sends a message from a workflow run to one person, or to a room: a workspace channel or a workspace's General. Cortex posts the message. A line under the message says which workflow sent it. Messages from automations shows what the recipient sees.
Cortex must be enabled for your organization. A message is sent from a workflow run, or from a Cortex conversation after you approve it.
Send a message from a workflow
Add the Cortex block and fill in:
| Field | What to enter |
|---|---|
| Send to | A person (their Cortex DM) or A channel. |
| Person | The person, picked from the people Cortex may message. Shown when sending to a person. |
| Channel | The room, picked from the rooms you have joined: a workspace channel or a workspace's General. Shown when sending to a channel. |
| Message | The message, in Markdown. |
| Idempotency key | A name for this message that is unique within the run, such as weekly-report. |
Inside a loop, make the key differ per iteration, for example report-<loop.index>.
A key already used in this run returns that first post, or is refused when the text
or recipient differs.
The block returns postId and status. status is published once the message
is in the room, or queued while Cortex is still delivering it. A queued message
is delivered without another run. If Cortex cannot deliver it after several
attempts, it gives up and the block does not tell you. The message may or may not
be in the room, so check the room before you run the block again with a new
idempotency key: a new key sends a new message, which can duplicate this one.
Who receives the message
The workflow sends as its Run As: a person, or a service account. Cortex checks the Run As's access before it posts. The Collaboration reference describes the targets in full.
- A person. The message goes to the recipient's own Cortex DM. If they have never opened Cortex, the DM is created for them and the message waits there. The Run As is never added to that DM. The recipient must be an active member of your organization whom Cortex may message.
- A room: a workspace channel or a workspace's General. The Run As must be a member of the room, and so must Cortex. A service account is a member of the channels and the General of the workspaces it belongs to, and can post in those and to people. Team targets are not available for now: a message addressed to a team is refused. An organization-wide channel such as Default cannot be a post target yet.
A run started by a webhook or a schedule sends as the workflow's saved Run As: its owner, unless an administrator has bound a service account to it. A run with no Run As and no owner cannot send.
In the workflow editor, the Person and Channel fields offer a list instead of an id: the people Cortex may message, and the rooms you have joined. Type to narrow the list: in an organization with many rooms, the list may not show every room until you type part of its name. The list is yours, but the step runs as the workflow's Run As: a room the Run As has not joined is refused when the step runs, even if you could pick it.
The Channel list shows a channel by its name, with its workspace's name
beside it, and a workspace's General as General with its workspace's name.
Typing a workspace's name finds its General, and typing General finds every
General you have joined. A channel is found by its own name, not by its
workspace's.
The Person list shows each person's name and nothing else. A person whose name Cortex does not hold yet is listed as Unnamed person, and two people who share a name look alike in the list. If the Channel list is empty, you have joined no room a workflow can post to yet: no channel and no workspace's General. Channels says who can create a channel.
From a Cortex conversation
You can also ask Cortex to send a message for you. Cortex asks first, and nothing is sent until you approve. The message is sent on your behalf, with the same checks as a workflow whose Run As is you.
A workflow that Cortex starts for a persona sends as that workflow's own Run As.
When a message is refused
A refused message is not sent. The block returns an error that starts with a
stable code you can match on, for example
not_a_channel_member: The automation's Run As is not a member of this room.
| Code | Meaning |
|---|---|
not_an_automation_run | The call did not come from a workflow run, a process-flow run or a Cortex conversation. |
run_as_required | The run has no Run As and no owner. |
run_as_service_account_unavailable | The run's Run As service account is deleted or disabled, or has no Cortex identity yet. |
run_as_not_a_person | The Run As person is not an active member, or has not appeared in Cortex's directory yet. |
extension_permission_not_granted | The extension that sends the message does not declare the permission to send Cortex messages, or was disabled while the run was in progress. |
recipient_not_messageable | Cortex cannot message this person, or there is no such person; the two are not told apart. |
not_a_channel_member | The Run As is not a member of the room. For every kind of room the code is the same. |
unknown_target | No such room in your organization, or one Cortex has not finished setting up or has retired. |
over_budget | The message is too large for one Cortex message. |
idempotency_key_reused | This run already used the key for a different message or recipient. |
collaboration_not_enabled | Cortex is not enabled for your organization, or is not ready for it yet. |
channel_not_bound | The room is not connected to Cortex. |
cortex_not_in_room | Cortex is not a member of the room. |
organization_rate | Your organization sent too many messages this minute. |
source_recipient_rate | This workflow sent too many messages to this recipient this hour. |
LLM_BLOCKED_BY_DLP | Data-loss prevention refused the text. A message is never sent with masked text. |
EGRESS_BLOCKED_BY_CLEARANCE | The message is classified above what the room allows. |
A failure that is not a refusal, such as Cortex being unable to check or record the message right now, carries no code. The Collaboration reference lists every error.
Retries and limits
- One message per key. Within one run, the same idempotency key always returns the first message and never posts twice. A retried block is therefore safe. The next run of the same workflow posts again, even with the same key.
- Limits. At most 30 messages per minute for your organization, and 10 per hour
from one workflow to one recipient. Over a limit, the message is refused with
organization_rateorsource_recipient_rate, and can be retried later. - No mentions. A message notifies nobody by name.
@roomand links to people are shown as plain text.