Remote Workflow Execution v2 is an enhancement of version v1.
Just like v1, users can execute Magnus Workflows remotely and asynchronously via HTTP.
Requests made to Remote Workflow Execution v2 are queued and processed by the Fair Scheduler.
Through v2, users can execute multiple instances of the same Workflow.
v2 is also integrated into Magnus Workflows in such a way that users can asynchronously execute a Workflow via an API Task.
Here is a feature comparison between v1 and v2:
|Running a Workflow via direct HTTP request||Yes||Yes|
|Running a Workflow via an API Task||Yes||Yes, but strongly not recommended since the JWT will be exposed in the request body|
|Running multiple instances of the same Workflow||Yes, when queue attribute is set to true||No|
Here are the two ways to invoke Remote Workflow Execution v2 explicitly:
- Via direct HTTP request
- Via an API Task within a Workflow
The maximum request size limit is 32 MB. Exceeding this limit will cause invalid error.
"value": string or number or boolean
|jwt||string||[Required] JWT created using the Google service account that has been registered with Magnus|
|c||713aa58d||[Required] Command for workflow run|
|configuration||nested object||[Required] Configuration of the request|
|configuration.runWorkflow||nested object||[Required] Run a workflow asynchronously|
|configuration.runWorkflow.l||string||[Required] Encoded workflow ID
User can obtain the encoded workflow ID from the permalink of the workflow:
[Optional] Specifies whether to queue this workflow execution or not.
The default value is false.
[Optional] The parameter overrides.
The parameter var_myParameter2 can be overridden. But the parameter var_myParameter1 cannot be overridden since it is owned by the workflow.
|configuration.runWorkflow.parameters.name||string||[Required] The parameter name. It is case-sensitive; user must provide the parameter name as it appears in the Workflow Editor.|
|configuration.runWorkflow.parameters.value||string||[Required] The parameter value. NULL is treated as empty string.|
If the workflow has started successfully, the following response body will be returned:
User can then check the progress of the workflow execution in Magnus History Browser. The historyId of the workflow execution can be accessed by the following steps in History Browser:
- Click Workflows History
- Click on the Details icon
- Click on the status icon on the bottom:
- The historyId is revealed:
If the workflow has failed to start, this response body will be returned:
Please see the Errors section for the list of error.
Workflow Execution Permission
The user must be owner or delegate of the Workflow.
If invoking via direct HTTP request, the Google service account must be the owner or delegate of the target workflow. If invoking via an API Task within a parent Workflow, the run user must be the owner or delegate of the target Workflow.
A user cannot have more than 100 Remote Workflow Execution v2 requests waiting in the queue. That is, if a user has already sent 100 Remote Workflow Executions with queue set to true, and at the moment these requests are waiting in the queue and have not been executed yet. Any more requests with queue set to true from the same user will be rejected with an error code of 429 until one or more of the waiting request has been processed from the queue.
|Error reason||HTTP code||Description|
This error is returned when:
|notFound||404||This error is returned when the workflow is not found|
|accessDenied||403||This error is returned when the Google service account does not have permission to execute the workflow|
|backendError||500||This error is returned when there is backend error in Magnus|