Workflow

class caliber.Workflow(process: Process | Dict | None = None, name: str | None = None, attach_files: List | None = None)[source]

A workflow which is based on a Process.

Parameters:
  • name (str) – The name of the workflow.

  • process (Process) – The process which is the basis for the workflow.

  • attach_files (list) – Files to attach to the workflow when it is put in a queue. Binary files should not be attached. Note that the files will only be processed when the workflow is sent.

run() bool[source]

Run all nodes that contain runable objects.

queue(pinion_name: str | None = None, host: str | None = None, project_id: str | None = None, model_name: str | None = None) bool[source]

Queue the workflow.

By default, the workflow is put in a local workflow queue. Use a Pinion to run the workflow queue. If host and project_id are provided, a remote workflow queue will be set up on the Speckle server.

Parameters:
  • pinion_name (str) – The name of the pinion to pass to.

  • host (Optional[str]) – The URL of the a Speckle server.

  • project_id (Optional[str]) – The ID of the Speckle project to use for data exchange.

  • model_name (Optional[str]) – The name of the model to use. The default name is ‘caliber’, and if the model is not found, it will be created.

show() None[source]

Show the workflow.

to_tree() Tree | None[source]

Return a Rich Tree that visualizes the Workflow.

to_dict() Dict[source]

Return dictionary representation of the Workflow object.

to_json(out_file: str | TextIO) None[source]

Export to a json-file.

Parameters:

out_file (str or file-like object) – The file to write to.

static from_json(infile: str) Workflow | None[source]

Initiate a Workflow from a json file.

Parameters:

infile (str) – The name of the json file.