Skip to main content

sendToWorkflow

A Graze API POST request that sends a Moolet Inform message to a workflow in an Inform Workflow Engine.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint sendToWorkflow takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

engine_name

String

Yes

Name of an active Inform Workflow Engine.

workflow_name

String

Yes

Name of an active workflow within the specified Inform Workflow Engine.

sitn_id

Number

No

ID of the Situation you want to send to the workflow.

alert_id

Number

No

ID of the alert you want to send to the workflow.

context

Map

No

Additional context to send with the message. This must be available as an action in the workflow as getWorkflowContext().

Response

Endpoint sendToWorkflow returns the following response:

Examples

The following examples demonstrate typical use of endpoint sendToWorkflow:

Request examples

Example cURL request to send a message to a Situation Inform Workflow Engine about Situation ID 12:

curl -X POST -u graze:graze -k "https://localhost/graze/v1/sendToWorkflow" \
-H "Content-Type: application/json; charset=UTF-8" \
--data '{
    "engine_name" : "Situation Inform Engine",
    "workflow_name": "Workflow name",
    "sitn_id": 12,
    "context": {"hello": "world"}
    }'

Example cURL request to send a message to an alert Inform Workflow Engine about alert ID 35:

curl -X POST -u graze:graze -k "https://localhost/graze/v1/sendToWorkflow" \
-H "Content-Type: application/json; charset=UTF-8" \
--data '{
    "engine_name" : "Alert Inform Engine",
    "workflow_name": "Workflow name",
    "alert_id": 35,
    "context": {"hello": "world"}
    }'

Response example