5. Workflow Requests
This section includes the HTTP requests to use for enabling, disabling, starting and stopping workflows and workflow groups, using the standard HTTP method POST. Each command includes a curl example.
Enabling Workflow
To enable a workflow, use the following command with HTTP method POST, as in the example.
http://<platform-host>:<webinterface-port>/webapi/<version>/workflows/<workflow-key>?action=enable
Example - Workflow Enable Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=enable" -u mzadmin:dr
Disabling Workflow
To disable a workflow, use the following command with HTTP method POST, as in the example.
http://<platform-host>:<webinterface-port>/webapi/<version>/workflows/<workflow-key>?action=disable
Example - Workflow Disable Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=disable" -u mzadmin:dr
Starting Workflow
To start a workflow, use the following command with HTTP method POST, as in the example.
Note!
To be able to start a workflow it must be enabled, see the section above, Enabling Workflow.
http://<platform-host>:<webinterface-port>/webapi/<version>/workflows/<workflow-key>?action=start&ec=<ec-name-1>,<ec-name-2>,<...>
Example - Workflow Start Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=start" -u mzadmin:dr $ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=start&ec=ec1" -u mzadmin:dr
Stopping Workflow
To stop a workflow, use the following command with HTTP method POST, as in the example:
http://<platform-host>:<webinterface-port>/webapi/<version>/workflows/<workflow-key>?action=stop&stoptype=<immediate|batch>
Example - Workflow Stop Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=stop" -u mzadmin:dr $ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=stop&stoptype=batch" -u mzadmin:dr $ curl -X POST "http://localhost:9000/webapi/v1/workflows/MZ1301496182687?action=stop&stoptype=immediate" -u mzadmin:dr
Enabling Workflow Group
To enable a workflow group, use the following command with HTTP method POST, as in the example.
http://<platform-host>:<webinterface-port>/webapi/<version>/workflows/workflow-groups/<group-key>?action=enable
Example - Workflow Group Enable Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=enable" -u mzadmin:dr
Disabling Workflow Group
To disable a workflow, use the following command with HTTP method POST, as in the example.
http://<platform-host>:<webinterface-port>/webapi/<version>/workflows/workflow-groups/<group-key>?action=disable -u mzadmin:dr
Example - Workflow Group Disable Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=disable"
Starting Workflow Group
To start a workflow group, use the following command with HTTP method POST, as in the example.
Note!
To be able to start a workflow group it must be enabled, see the section above, Enabling Workflow Group.
http://<platform-host>:<webinterface-port>/webapi/<version>/workflow-groups/<group-key>?action=start&ec=<ec-name-1>,<ec-name-2>,<...>
Example - Workflow Group Start Request
$ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=start" -u mzadmin:dr $ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=start&ec=ec1" -u mzadmin:dr
Note!
if a Workflow Group has been configured to execute on a specific EC or several ECs, it is not possible to start the Workflow Group on another EC(s)! For further information about Execution Settings for Workflow Groups, refer to 3.2 Workflow Group in Desktop user's guide.
Stopping Workflow Group
To stop a workflow group, use the following command with HTTP method POST, as in the example:
http://<platform-host>:<webinterface-port>/webapi/<version>/workflow-groups/<group-key>?action=stop&stoptype=<immediate|batch>
Example - Workflow Group Stop Command
$ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=stop" -u mzadmin:dr $ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=stop&stoptype=batch" -u mzadmin:dr $ curl -X POST "http://localhost:9000/webapi/v1/workflow-groups/MZ1301496182687?action=stop&stoptype=immediate" -u mzadmin:dr