Provided Methods

executeAsync

Description

Executes the workflow with the given ID and version, or with name and the given project ID and version asynchronously. Execute by name can be configured with force_exact_match and force_distinct. Use variables, if the workflow relies on them. 

The WorkflowJob is returned immediately, even if the execution is still running. If version is not specified, the latest version is executed. Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.


Returns: WorkflowJob

Parameters

PropertyTypeRequiredDefaultDescription
iduuid.UUIDfalseNoneID of the workflow
versionuuid.UUIDfalseNoneversion of the workflow
namestrfalseNonename of the workflow
project_iduuid.UUIDfalseNoneId of the project workflow belongs to. When execute by id, project_id will be ignored.
force_exact_matchboolfalseTrueSearch for exact match, False: Data table includes the name
force_distinctboolfalseTrueRaise exception if name is ambiguous, False: execute first match
variable_assignments[dict]falseNonelist of variable assignments





Usage

# execute the workflow async
job: WorkflowJob = od.workflows.execute_async(id=workflow.id, variable_assignments=[
    {"variableType": "integer", "variableName": "myVar", "variableValue": 5}])

executeSync

Description

Executes the workflow with the given ID and version, or with name and the given project ID and version synchronously. Execute by name can be configured with force_exact_match and force_distinct. Use variables, if the workflow relies on them. The WorkflowJob is not returned immediately. The SDK will request the WorkflowJob until a terminal state of the execution is reached. If version is not specified, the latest version is executed.


Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.

Returns: WorkflowJob

Parameters

PropertyTypeRequiredDefaultDescription
iduuid.UUIDfalseNoneID of the workflow
versionuuid.UUIDfalseNoneversion of the workflow
namestrfalseNonename of the workflow
project_iduuid.UUIDfalseNoneId of the project workflow belongs to. When execute by id, project_id will be ignored.
force_exact_matchboolfalseTrueSearch for exact match, False: Data table includes the name
force_distinctboolfalseTrueRaise exception if name is ambiguous, False: execute first match
variable_assignments[dict]falseNonelist of variable assignments

Usage

# execute the workflow sync
job: WorkflowJob = onedata_api.workflows.execute_sync(workflow.id)