[Beta] List available action and trigger types
curl --request GET \
--url http://localhost:8080/workflows/definitions \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/workflows/definitions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/workflows/definitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/workflows/definitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/workflows/definitions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/workflows/definitions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/workflows/definitions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"action_types": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"category": "<string>",
"icon": "<string>",
"input_fields": [
{
"name": "<string>",
"type": "<string>",
"display_name": "<string>",
"required": true,
"description": "<string>"
}
],
"output_fields": [
{
"name": "<string>",
"type": "<string>",
"display_name": "<string>",
"required": true,
"description": "<string>"
}
],
"input_shape": "<unknown>",
"output_shape": "<unknown>",
"supported_trigger_types": [
"<string>"
],
"can_test": true
}
],
"trigger_types": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"payload_def": "<unknown>",
"configuration_def": "<unknown>"
}
],
"block_types": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>"
}
],
"operators": [
{
"name": "<string>",
"display_name": "<string>",
"type": "Unary",
"applies_to": [
"String"
]
}
],
"extra_variables": [
"<unknown>"
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Workflows (Beta)
[Beta] List available action and trigger types
List all available workflow action types and trigger types with their metadata. Use when managing deterministic workflow definitions and triggering or inspecting their runs.
GET
/
workflows
/
definitions
[Beta] List available action and trigger types
curl --request GET \
--url http://localhost:8080/workflows/definitions \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/workflows/definitions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/workflows/definitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/workflows/definitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/workflows/definitions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/workflows/definitions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/workflows/definitions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"action_types": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"category": "<string>",
"icon": "<string>",
"input_fields": [
{
"name": "<string>",
"type": "<string>",
"display_name": "<string>",
"required": true,
"description": "<string>"
}
],
"output_fields": [
{
"name": "<string>",
"type": "<string>",
"display_name": "<string>",
"required": true,
"description": "<string>"
}
],
"input_shape": "<unknown>",
"output_shape": "<unknown>",
"supported_trigger_types": [
"<string>"
],
"can_test": true
}
],
"trigger_types": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"payload_def": "<unknown>",
"configuration_def": "<unknown>"
}
],
"block_types": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>"
}
],
"operators": [
{
"name": "<string>",
"display_name": "<string>",
"type": "Unary",
"applies_to": [
"String"
]
}
],
"extra_variables": [
"<unknown>"
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Email metadata on message triggers
Contact Message Received (contact-message-received) and First Contact
Message Received (first-contact-message-received) remain available across
channels. For email sessions, they also expose an optional email object when
recipient metadata is stored for the triggering message:
| Variable | Value |
|---|---|
{{trigger.email.from}} | Original sender address, when available. |
{{trigger.email.to}} | Array of visible To recipients. |
{{trigger.email.cc}} | Array of visible CC recipients; empty when none are stored. |
{{trigger.ticket.channel}} is email and that email is available
before using these variables. They describe the exact message identified by
messageId, even if later replies change the recipients. They do not use the
session’s contact email as a substitute for missing headers.
Non-email sessions and messages without stored headers omit email. BCC
recipients are not exposed. If your inbox receives a blind copy, use the original
message’s visible To and CC recipients as needed. Selecting these addresses does
not change the session’s contact or send an email automatically.
Monitor session volume
Monitor Session Volume (monitor-session-volume) counts sessions created in a
rolling window. It returns the total and links to a small sample. Add conditions,
notifications, or other actions after it to build the behavior you need.
The node is available only in workflows with a Cron Trigger whose scheduled
runs are at least five minutes apart (for example, */5 * * * *). Faster
schedules are rejected at activation and execution, including for nested monitor
nodes and schedules with a run limit of one. Other workflow triggers cannot
activate or execute it. You can manually test a workflow whose
saved trigger is cron. If the node is absent, it is not available on your deployment yet.
Configure the node
- Create a cron workflow that runs every five minutes or less frequently.
- Add Monitor Session Volume and set Window (minutes) to a whole number
from
1to120. The default is120(two hours). - Optionally set Tag to an exact tag name. Leave it empty to count all eligible sessions. For example, a classification workflow could tag access reports, while this workflow counts sessions with that tag.
- Add any downstream logic you need. For “more than eight sessions,” use an
If/Else condition checking whether
{{volume.count}}is greater than8, wherevolumeis the monitor node ID. Add notification actions in that branch.
windowMinutes and optional tag. It has no
threshold, reset timer, update interval, category grouping, source-date override,
incident tracking, or notification destination. Tests of the monitor send nothing;
notification actions added afterward can send real messages during workflow tests.
Outputs
| Output | Meaning |
|---|---|
count | Total matching sessions in the window. This is not limited to the sample size. |
windowStart | Exclusive start of the evaluated window in ISO 8601 UTC. |
windowEnd | Inclusive end of the evaluated window in ISO 8601 UTC. |
sampleSessions | Up to ten newest matches, each with id, optional number, createdAt, and url. |
Counting behavior
The window is(now - window, now], using Open session creation time. Resolved
sessions still count. Each session counts once, independent of its source channel
or external system. Imports are measured from when the Open session was created;
use an appropriate tag if historical imports should be excluded.
Spam and test billing exclusions, the Spam/Junk and companion-test tags,
internal sessions, and child sessions are excluded. Counts are organization-scoped.
Reporting data can lag newly created or updated sessions and tags. A successful
query does not guarantee that every recent change has arrived. Query errors fail
the workflow rather than returning zero or a partial count.
Updating an earlier draft
Remove the old threshold, reset/update timing, category, and source-creation inputs. ReplaceshouldAlert or thresholdReached conditions with comparisons against
count. Incident IDs, category counts, and busy flags are no longer returned.
Earlier Slack-specific drafts must also move their message configuration into a
separate notification node. Review notification frequency before activating an
existing draft, because the monitor no longer throttles it.
Keep session attributes internal
Update Session Attributes (merge-custom-data) merges the values in
customData into the session identified by ticketNumber. Existing attributes
that are absent from the input remain unchanged.
Sync to connected integration (reflectOnIntegration) defaults to true,
preserving existing workflow behavior. Set it to false for internal review
scores, coaching notes, or other attributes that should stay in OpenCX. The
session is still updated and applicable Session Updated workflows still run;
this option only disables reflecting those attributes to the connected integration.
Set the session subject
Set session subject (set-session-subject) replaces the subject of a session in the
current organization. Set ticketNumber to the session number and subject to the new
text; both accept variables such as {{trigger.ticket.ticketNumber}},
{{trigger.ticket.contact.name}} or, with the Macro Called trigger,
{{trigger.macro.name}}. Surrounding spaces are trimmed and subjects longer than 255
characters are cut. The step fails when the subject is empty or the session number does
not exist in the organization.
The output returns the subject that was set and noChange: true when the session
already had it. Each change appears on the session’s internal timeline. The new subject
is used for later email replies on the session and is not sent to connected helpdesks.
Link the workflow to a macro to change the subject whenever an agent sends that macro
(see macro workflows).
Snooze a session
Snooze Session (snooze-session) is available when native OpenCX ticketing and
Settings → Workspace → Sessions → Session snoozing → Enable session snoozing are enabled. The definitions
endpoint omits this action when it is unavailable.
Set ticketNumber to a session number in the current organization and
durationMinutes to a finite number of at least 1. The output snoozedUntil is
the scheduled wake-up time in ISO 8601 UTC. Duration is measured from step
execution; the workflow continues immediately after applying Snooze.
The session must be open and human-assigned or unassigned, with no active call.
The setting is checked again at execution, so disabling it also blocks already
saved workflows from snoozing sessions. See session snoozing
for wake-up, capacity, and SLA behavior.
The Reopen action (reopen-ticket) also clears native Snooze. With session
snoozing enabled, it unassigns an offline human agent by default and returns the
session to its existing team’s assignment queue. If Keep assigned agent when
recently offline is enabled, the agent retains ownership while their continuous
offline time is below the workspace threshold. Unknown offline times use normal
queue routing. See session snoozing for the setting.
Online agents retain ownership. Reopening
a closed session preserves its existing assignment. The action’s input and
output remain unchanged.
The workflow editor provides duration presets and a custom minutes input; stored
durationMinutes values and numeric references remain compatible. Workflow session
payloads report ticketStatus: "snooze" while a session is snoozed. Session Updated
emits a status change on entering or leaving Snooze, including the previous and
new status values. A deadline change alone does not emit another status change.
Restrict contact channels
Restrict Contact Channels (set-contact-restricted-channels) changes the channels a
contact asked not to be contacted on, for example after a customer replies “please stop
texting me”. See restricted channels for
what a restriction stops.
| Input | Meaning |
|---|---|
contactId | The contact to change, for example {{trigger.contact.id}}. |
mode | Change: add (the default) restricts the selected channels and keeps the rest, remove lifts only the selected channels, and set replaces the whole list. |
channels | Any of email, sms, whatsapp and phone_voice. A variable can also pass them as one comma-separated text. With set, no channels lifts every restriction. |
contactId, restrictedChannels (the list after the change) and
changed, which is false when the list was already as requested and nothing was
written. Running the step again with the same input is safe.
The step fails when add or remove has no channels, a channel is not one of the four,
or the contact is not in the organization. Each change is recorded in the audit log as
made by the workflow, with the workflow and run IDs. It doesn’t fire the Contact
Updated trigger, so a Contact Updated workflow that uses this step can’t trigger itself.
On a restricted channel, workflow steps that start a send, such as Send Email
Template, Make phone call or Start AI Session, fail with the reason and send
nothing.Authorizations
Response
Default Response
Field schemas for the extra reference scopes available in every run, beyond the trigger payload and step outputs. Each entry's "name" is the scope root and its "properties" are the referenceable fields: {{metadata.}} (date/time of the run), {{run.}}, {{workflow.}}, {{organization.}}, and {{variables.}} for the organization's global variables. Leaf scopes have no "properties" and are referenced directly, e.g. {{routingSkills}} — a JSON string of every org skill (name + description).
Was this page helpful?