Moogsoft Docs

updateWorkflow

A Graze API POST request that updates an existing workflow in the Workflow Engine.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint updateWorkflow takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

id

String

Yes

ID of the workflow that you want to update.

workflow_name

String

No

Name of the workflow.

active

Boolean

No

Determines whether the workflow is active or not.

description

String

No

Description of the workflow.

entry_filter

JSON

No

Filter to determine which events, alerts or Situations can enter the workflow. You can use an SQL-like query. See Create an advanced filter for more information on creating SQL-like filters. If empty, the workflow accepts all events, alerts or Situations.

sweep_up_filter

JSON

No

Filter to intake any additional events, alerts or Situations from the database. You can use an SQL-like query. See Create an advanced filter for more information on creating SQL-like filters.

first_match_only

Boolean

No

If enabled, events, alerts, and Situations only pass through actions on the first time they enter the Workflow Engine.

operations

JSON List

No

List of properties relating to each operation:

Name

Type

Required

Description

type

String

Yes

Type of operation. Options are: 'action', 'decision' and 'delay'.

operation_name

String

Yes, for 'action' and 'decision' types.

Name of the operation.

function_name

String

Yes, for 'action' and 'decision' types.

Name of the function.

forwarding_behavior

String

No

function_args

JSON Object

No

Arguments for the function.

duration

Integer

Yes, for 'delay' type.

Length of time before the message goes to the next operation.

reset

Boolean

Yes, for 'delay' type.

Determines whether the timer resets after each occurrence.

Response

Endpoint updateWorkflow returns the following response:

Examples

The following examples demonstrate typical use of endpoint updateWorkflow:

Request examples

Example cURL request to deactivate workflow id 14:

curl -X POST -u graze:graze -k \
     -v "https://localhost/graze/v1/updateWorkflow" \
     -H "Content-Type: application/json; charset=UTF-8" \
     --data '{
         "id" : 14,
         "active" :false
        }'

Example cURL request to rename workflow id 14:

curl -X POST -u graze:graze -k \
     -v "https://localhost/graze/v1/updateWorkflow" \
     -H "Content-Type: application/json; charset=UTF-8" \
     --data '{
         "id" : 14,
         "workflow_name" : "Deactivated Example"
        }'
Response example