Control Room Webhooks
One of the key features of any integration is the ability to receive events from the platform instead of having to poll the APIs for status updates. We believe webhooks are the simple and efficient technology for achieving this goal.
Robocorp offers webhooks in several scopes: workspace
, process
and process run
.
You can manage your webhooks from your workspace's Integrations
section.
General features
To register a webhook, some simple steps should be followed: select the scope of the webhook (workspace
or process
),
enter your webhook endpoint address and optionally configure the events you want to receive.
In case you selected process
scoped webhook, you also need to select a process from your workspace.
After registering, a webhook can be managed from the webhooks table or going to the webhook view.
In the webhook view you can:
- Update name, endpoint and outgoing events of the webhook
- View the shared secret used for HMAC signature calculation (see details for the HMAC signature below).
- Send test events (see event structure below)
- View webhook logs (see details below)
HMAC signature
To verify that the webhook invocation is coming from Control Room,
each event is sent with HMAC signature in the x-rc-signature
header.
The signature is calculated from the whole request body using SHA-256
hash function and shared secret. You can view the shared secrets from
the Control Room UI.
Example for calculating the signature:
Webhook logs
In the webhook view you can see the events that have been sent to your endpoint. In case there was a problem with delivering the event, information regarding the error is shown to help you resolve the issue. Log entries are stored for 2 weeks.
Show data
button will show the payload of the event that was sent.
Note: Process run event logs can be examined from the process run timeline view as well.
Test event payload
Variable values are id
, webhookEventTimestamp
and payload.workspaceId
.
Otherwise the event content is as in the example below.
Workspace Scoped Webhooks
Workspace scoped webhooks can deliver multiple types of events.
- Process runs
- Step runs
- Robot run events
- Assistant runs
Payload formats are documented below.
Common event structure
Attribute | Type | Description |
---|---|---|
id | string | Uniqued identifier for the reported event. Note: there is a "at least once" guarantee for event delivery which means in some cases the same event may be reported multiple times. You can use this if you need to ensure you only process events once. |
webhookEventTimestamp | string | The timestamp for webhook invocation. |
event | string | The name of the event that triggered the webhook invocation. |
action | string | Event specific action. |
Robot Process Run event structure
These events are specific to a single process run and the event
attribute always
has the value set as process_run
. In addition to the standard attributes
this event also has following event-specific attributes:
Attribute | Type | Description |
---|---|---|
action | string | The action that was performed. May be one of STARTED , COMPLETED |
payload.workspaceId | string | The id of the workspace in which the event happened. |
payload.processId | string | The id of the process in which the event happened. |
payload.processRunId | string | The id of the process run in which the event happened. |
payload.state | string | The status of the run. May be one of IP (in-progress), COMPL (completed). |
payload.duration | integer | Present when action is COMPLETED . The duration of the run, in seconds. |
payload.result | string | Present when action is COMPLETED . May be one of success , error . |
payload.errorCode | string | Present when action is COMPLETED and result is error . |
Example
Step Run Status Event structure
These events are specific to a single step run and the event
attribute always
has the value set as step_run_status
. In addition to the standard attributes
this event also has following event specific attributes:
Attribute | Type | Description |
---|---|---|
action | string | The action that was performed. May be one of STARTED , COMPLETED |
payload.workspaceId | string | The id of the workspace in which the event happened. |
payload.processId | string | The id of the process in which the event happened. |
payload.processRunId | string | The id of the process run in which the event happened. |
payload.stepId | string | The id of the step in which the event happened. |
payload.stepName | string | The name of the step in which the event happened. |
payload.id | string | The id of the step run in which the event happened. |
payload.state | string | The state of the step run. May be one of IP (in-progress), COMPL (completed). |
payload.stateTs | string | The timestamp of the state of the step run. |
payload.startTs | string | The timestamp of when the step run started. |
payload.endTs | string | Present when action is COMPLETED . The timestamp of when the step run ended. |
payload.duration | integer | Present when action is COMPLETED . The duration of the run, in seconds. |
payload.result | string | Present when action is COMPLETED . May be one OK , ERR , TIMEOUT , TERMINATED , CONNLOSS , START_FAILED |
Example
Robot Run Event structure
These events are specific to a single robot run and the event
attribute always
has the value set as robot_run_event
. In addition to the standard attributes
this event also has following event-specific attributes:
Attribute | Type | Description |
---|---|---|
action | string | The action that was performed. May be one of (in seqNo order): START , BUNDLE_DL_START , BUNDLE_DL_END , BUNDLE_INFO , BUNDLE_UNPACK_START , BUNDLE_UNPACK_END , ENV_SETUP_START , ENV_SETUP_END , EXECUTE_START , EXECUTE_END , ARTIFACT_UL_START , ARTIFACT_UL_END , END . |
payload.workspaceId | string | The id of the workspace in which the event happened. |
payload.processId | string | The id of the process in which the event happened. |
payload.processRunId | string | The id of the process run in which the event happened. |
payload.robotRunId | string | The id of the robot run in which the event happened. |
payload.seqNo | integer | Sequence number for the event. Robot runs event have a specific order and each event has a sequence number, starting from 1 . This can be used for ordering the events if they are received out-of-order due to request timings etc. |
payload.timeStamp | string | Robot run event's timestamp. |
payload.eventType | string | Type of the event. Same value as in action . |
payload.data | object | Optional Action specific object with additional information related to the event. |
Example
Robot Assistant Run event structure
These events are specific to a single assistant run and the event
attribute always
has the value set as assistant_run
. In addition to the standard attributes
this event also has the following specific attributes:
Attribute | Type | Description |
---|---|---|
action | string | The action that was performed. May be STARTED or COMPLETED |
payload.organizationId | string | The id of the organization in which the event happened. |
payload.workspaceId | string | The id of the workspace in which the event happened. |
payload.assistantId | string | The id of the assistant in which the event happened. |
payload.assitantName | string | The name of the assistant in which the event happened. |
payload.assistantRunId | string | The id of the assistant run in which the event happened. |
payload.runNo | integer | Specific run number (run number for each assistant starts from 1) |
payload.state | string | The status of the run. May be IP (in-progress) orCOMPL (completed). |
payload.createTs | string | The timestamp of when the assistant run was created |
payload.stateTs | string | The timestamp of the state of the assistant run. |
payload.startTs | string | The timestamp of when the assistant run started. |
payload.robot.id | string | The id of the robot that was run. |
payload.robot.name | string | The name of the robot that was run. |
payload.robot.task | string | The task of the robot that was run. |
payload.startedBy.firstName | string | First name of the user who started the assistant run. |
payload.startedBy.lastName | string | Last name of the user who started the assistant run. |
payload.startedBy.userId | string | User id of the user who started the assistant run. |
payload.startedBy.email | string | Email of the user who started the assistant run. |
payload.startedBy.pictureUrl | string | Picture URL of the user who started the assistant run. |
payload.endTs | string | Present when action is COMPLETED . The timestamp of when the assistant run ended. |
payload.duration | integer | Present when action is COMPLETED . The duration of the run, in seconds. |
payload.result | string | Present when action is COMPLETED . May be one of OK , ERROR , TIMEOUT , TERMINATED . |
payload.error | string | Present when action is COMPLETED and result is ERROR . |
Example
Process Scoped Webhooks
Process scoped webhooks are configured per process. They can deliver only process run events. For convenience, basic management(creation, deletion) of process scoped webhooks can be done also from the process configuration: Process -> Configure -> Notifications -> Webhook Notifications
Process scoped webhooks have a payload structure different from Workspace scoped webhooks. Main differences are the general structure and the inclusion of output work item data. Payload formats are documented below.
Started process run
Completed process run
Unresolved process run
Process Run Scoped Webhooks
Process run scoped webhook is a special type of webhook that is only used for a singular process run.
They are not visible in the Integrations
section and can only be created when starting a process run via the
Start process with provided configuration
(/workspaces/{workspaceId}/processes/{processId}/run-request
)
endpoint of the Robocorp Process API. In this use case three extra payload parameters need to be defined:
callbackUrl
, secret
and eventsToSend
.
Example request payload:
After the process run has completed, the webhook is removed. Logs are still collected and can be examined from the process run timeline view.
Event Payloads
Process run scoped payloads are identical to Process scoped payload (see above).