> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow class

**Namespace:** [Ans.DataProcessing](https://developer.synopsys.com/docs/dpf/dpf-mechanical/api/Ans.DataProcessing)

## Summary

Container of fields.

A workflow is a black box containing operators and exposing only the necessary operator's

inputs and outputs to compute a given algorithm

## Example

```python theme={null}
disp_op = dpf.operators.result.displacement()

max_fc_op = dpf.operators.min_max.min_max_fc(disp_op)

workfow = dpf.Workflow()

workfow.Add(disp_op)

workfow.Add(max_fc_op)

workfow.SetInputName(disp_op, 4, "data_sources")

workfow.SetOutputName(max_fc_op, 0, "min")

workfow.SetOutputName(max_fc_op, 1, "max")

workfow.connect("data_sources", my_data_sources)

min = workfow.GetOutputAsField("min")

max = workfow.GetOutputAsField("max")
```

## Class Information

| Property | Value |
| - | - |
| Namespace | `Ans.DataProcessing` |
| Assembly | `CS_DataProcessing` |
| Base Class | `Ans.DataProcessing.internal_objects.DpfType` |

## Constructors

#### Constructor

```python theme={null}
Workflow()
```

#### Constructor

```python theme={null}
Workflow(wf_ptr)
```

**Parameters:**

* `wf_ptr` (*IntPtr*)

#### Constructor

```python theme={null}
Workflow(id)
```

**Parameters:**

* `id` (*int*)

## Methods

#### SetOutputContour

Method `SetOutputContour` exposes an output as "contour".

This contour output can be requested and computed afterwards to be plotted.

```python theme={null}
obj.SetOutputContour(op, pin, gfxCntrType)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputContour

```python theme={null}
obj.SetOutputContour(op, gfxCntrType)
```

**Parameters:**

* `op` (*BaseOperator*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputContour

```python theme={null}
obj.SetOutputContour(pin, gfxCntrType)
```

**Parameters:**

* `pin` (*LinkableOutput*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputContour

```python theme={null}
obj.SetOutputContour(pin, gfxCntrType)
```

**Parameters:**

* `pin` (*LinkableOutput*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputContour

```python theme={null}
obj.SetOutputContour(pin, gfxCntrType)
```

**Parameters:**

* `pin` (*LinkableOutput*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputContour

```python theme={null}
obj.SetOutputContour(fields, gfxCntrType)
```

**Parameters:**

* `fields` (*FieldsContainer*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputContour

```python theme={null}
obj.SetOutputContour(field, gfxCntrType)
```

**Parameters:**

* `field` (*Field*)
* `gfxCntrType` (*GFXContourType* (optional))

#### SetOutputWarpField

Method `SetOutputWarpField` exposes an output as "warp".

This warping output can be requested and computed afterwards to be used as warping (or deformed shape) of a contour.

```python theme={null}
obj.SetOutputWarpField(op, pin)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)

#### SetOutputWarpField

```python theme={null}
obj.SetOutputWarpField(op)
```

**Parameters:**

* `op` (*BaseOperator*)

#### SetOutputWarpField

```python theme={null}
obj.SetOutputWarpField(pin)
```

**Parameters:**

* `pin` (*LinkableOutput*)

#### SetOutputWarpField

```python theme={null}
obj.SetOutputWarpField(pin)
```

**Parameters:**

* `pin` (*LinkableOutput*)

#### SetOutputWarpField

```python theme={null}
obj.SetOutputWarpField(pin)
```

**Parameters:**

* `pin` (*LinkableOutput*)

#### SetOutputWarpField

```python theme={null}
obj.SetOutputWarpField(fields)
```

**Parameters:**

* `fields` (*FieldsContainer*)

#### SetOutputWarpField

```python theme={null}
obj.SetOutputWarpField(field)
```

**Parameters:**

* `field` (*Field*)

#### SetOutputMesh

Method `SetOutputMesh` exposes an output as "mesh".

This mesh (which should be a MehedRegion or a MeshesContainer) output can be requested and computed afterwards to be used as a mesh to plot a contour on.

```python theme={null}
obj.SetOutputMesh(op, pin)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)

#### SetOutputMesh

```python theme={null}
obj.SetOutputMesh(op)
```

**Parameters:**

* `op` (*BaseOperator*)

#### SetOutputMesh

```python theme={null}
obj.SetOutputMesh(pin)
```

**Parameters:**

* `pin` (*LinkableOutput*)

#### SetOutputMesh

```python theme={null}
obj.SetOutputMesh(pin)
```

**Parameters:**

* `pin` (*LinkableOutput*)

#### SetOutputMesh

```python theme={null}
obj.SetOutputMesh(pin)
```

**Parameters:**

* `pin` (*LinkableOutput*)

#### SetOutputMesh

```python theme={null}
obj.SetOutputMesh(meshes)
```

**Parameters:**

* `meshes` (*MeshesContainer*)

#### SetOutputMesh

```python theme={null}
obj.SetOutputMesh(mesh)
```

**Parameters:**

* `mesh` (*MeshedRegion*)

#### SetInputTime

```python theme={null}
obj.SetInputTime(op, pin)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)

#### InstantiateOnRemote

```python theme={null}
result = obj.InstantiateOnRemote(ip, port)
```

**Parameters:**

* `ip` (*str*)
* `port` (*int*)

**Returns:** *Workflow*

#### SetInputMeshScoping

```python theme={null}
obj.SetInputMeshScoping(op, pin)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)

#### SetInputBodyScoping

```python theme={null}
obj.SetInputBodyScoping(op, pin)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)

#### ConnectWith

Method `ConnectWith` Chain 2 workflows together so that they become one workflow.

All the operators, inputs and outputs of left\_workflow are exposed in

this workflow.

```python theme={null}
obj.ConnectWith(leftWorkflow)
```

**Parameters:**

* `leftWorkflow` (*Workflow*)

#### ConnectWith

```python theme={null}
obj.ConnectWith(leftWorkflow, outputsToInputs)
```

**Parameters:**

* `leftWorkflow` (*Workflow*)
* `outputsToInputs` (*dict*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*BaseOperator*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*Field*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*BaseCollection*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*int*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*bool*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*float*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*str*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*Scoping*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*DataSources*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*MeshedRegion*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*PropertyField*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*TimeFreqSupport*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*CyclicSupport*)

#### Connect

```python theme={null}
obj.Connect(inputPinName, value)
```

**Parameters:**

* `inputPinName` (*str*)
* `value` (*list*)

#### GetOutputAsFieldsContainer

```python theme={null}
result = obj.GetOutputAsFieldsContainer(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *FieldsContainer*

#### GetOutputAsScopingsContainer

```python theme={null}
result = obj.GetOutputAsScopingsContainer(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *ScopingsContainer*

#### GetOutputAsDataSources

```python theme={null}
result = obj.GetOutputAsDataSources(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *DataSources*

#### GetOutputAsField

```python theme={null}
result = obj.GetOutputAsField(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *Field*

#### GetOutputAsScoping

```python theme={null}
result = obj.GetOutputAsScoping(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *Scoping*

#### GetOutputAsCyclicSupport

```python theme={null}
result = obj.GetOutputAsCyclicSupport(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *CyclicSupport*

#### GetOutputAsString

```python theme={null}
result = obj.GetOutputAsString(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *str*

#### GetOutputAsInt

```python theme={null}
result = obj.GetOutputAsInt(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *int*

#### GetOutputAsDouble

```python theme={null}
result = obj.GetOutputAsDouble(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *float*

#### GetOutputAsTimeFreqSupport

```python theme={null}
result = obj.GetOutputAsTimeFreqSupport(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *TimeFreqSupport*

#### GetOutputAsMeshesContainer

```python theme={null}
result = obj.GetOutputAsMeshesContainer(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *MeshesContainer*

#### GetOutputAsMeshedRegion

```python theme={null}
result = obj.GetOutputAsMeshedRegion(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *MeshedRegion*

#### GetOutputAsResultInfo

```python theme={null}
result = obj.GetOutputAsResultInfo(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *ResultInfo*

#### GetOutputAsPropertyField

```python theme={null}
result = obj.GetOutputAsPropertyField(outputPinName)
```

**Parameters:**

* `outputPinName` (*str*)

**Returns:** *PropertyField*

#### HasTag

```python theme={null}
result = obj.HasTag(tag)
```

**Parameters:**

* `tag` (*WorkFlowTags*)

**Returns:** *bool*

#### AddTag

```python theme={null}
obj.AddTag(tag)
```

**Parameters:**

* `tag` (*WorkFlowTags*)

#### WriteToGraphViz

```python theme={null}
obj.WriteToGraphViz(filename)
```

**Parameters:**

* `filename` (*str*)

#### FromTemplate

```python theme={null}
result = obj.FromTemplate(template_name)
```

**Parameters:**

* `template_name` (*str*)

**Returns:** *Workflow*

#### TemplateExists

```python theme={null}
result = obj.TemplateExists(template_name)
```

**Parameters:**

* `template_name` (*str*)

**Returns:** *bool*

#### discoverAllOperators

```python theme={null}
obj.discoverAllOperators()
```

#### GetRecordedId

```python theme={null}
result = obj.GetRecordedId()
```

**Returns:** *int*

#### GetInternalData

```python theme={null}
result = obj.GetInternalData()
```

**Returns:** *IntPtr*

#### Record

Add the workflow to DPF's internal registry with an id returned by this method.

The workflow can be recovered by wf = Workflow(id)

```python theme={null}
result = obj.Record(identifier, transferOwnership)
```

**Parameters:**

* `identifier` (*str*)
* `transferOwnership` (*bool*)

**Returns:** *int*

#### Derivate

```python theme={null}
obj.Derivate(pinName, variableName)
```

**Parameters:**

* `pinName` (*str*)
* `variableName` (*str* (optional))

#### WriteToFile

```python theme={null}
obj.WriteToFile(filePath)
```

**Parameters:**

* `filePath` (*str*)

#### LoadFromFile

```python theme={null}
obj.LoadFromFile(filePath)
```

**Parameters:**

* `filePath` (*str*)

#### Add

Method `Add` adds an Operator to the list of operators in the workflow.

You do not need to add all operators to the workflow. The list of operators is mostly used

to compute progress while a workflow is running.

```python theme={null}
obj.Add(op)
```

**Parameters:**

* `op` (*BaseOperator*)

#### Add

```python theme={null}
obj.Add(ops)
```

**Parameters:**

* `ops` (*list*)

#### GetNumberOfOperators

```python theme={null}
result = obj.GetNumberOfOperators()
```

**Returns:** *int*

#### SetInputName

Method `SetInputName` exposes an input using its name. You can then connect inputs using the input name on the given operator.

```python theme={null}
obj.SetInputName(op, pin, name)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)
* `name` (*str*)

#### SetOutputName

Method `SetOutputName` forwards data as an output so you can request this data by its name.

```python theme={null}
obj.SetOutputName(data, name)
```

**Parameters:**

* `data` (*object*)
* `name` (*str*)

#### SetOutputName

Method `SetOutputName` exposes an output by its name so that you can request the computed outputs of the given operator

using the output name aftewards.

```python theme={null}
obj.SetOutputName(op, pin, name)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)
* `name` (*str*)

#### SetOutputChart

```python theme={null}
obj.SetOutputChart(op, pin, chart, chart_label)
```

**Parameters:**

* `op` (*BaseOperator*)
* `pin` (*int*)
* `chart` (*ChartType* (optional))
* `chart_label` (*str* (optional))

#### SetOutputChart

```python theme={null}
obj.SetOutputChart(op, chart, chart_label)
```

**Parameters:**

* `op` (*BaseOperator*)
* `chart` (*ChartType* (optional))
* `chart_label` (*str* (optional))

#### SetOutputChart

```python theme={null}
obj.SetOutputChart(pin, chart, chart_label)
```

**Parameters:**

* `pin` (*LinkableOutput*)
* `chart` (*ChartType* (optional))
* `chart_label` (*str* (optional))

#### SetOutputChart

```python theme={null}
obj.SetOutputChart(pin, chart, chart_label)
```

**Parameters:**

* `pin` (*LinkableOutput*)
* `chart` (*ChartType* (optional))
* `chart_label` (*str* (optional))

#### SetOutputChart

```python theme={null}
obj.SetOutputChart(pin, chart, chart_label)
```

**Parameters:**

* `pin` (*LinkableOutput*)
* `chart` (*ChartType* (optional))
* `chart_label` (*str* (optional))

## Properties

#### Id

**Type:** *int*

```python theme={null}
# Get the property (read-only)
value = obj.Id
```

#### Operators

Property `Operators` returns the list of Operators added with the method Workflow\.Add

**Type:** *list*

```python theme={null}
# Get the property (read-only)
value = obj.Operators
```

#### Inputs

Property `Inputs` returns the list of input names that have been exposed with the method Workflow\.SetInputName

and its derivates (Workflow\.SetInputMeshScoping, Workflow\.SetInputBodyScoping...)

**Type:** *list*

```python theme={null}
# Get the property (read-only)
value = obj.Inputs
```

#### Outputs

Property `Outputs` returns the list of output names that have been exposed with the method Workflow\.SetOutputName

and its derivates (Workflow\.SetOutputChart, Workflow\.SetOutputContour, Workflow\.SetOutputWarpField...)

**Type:** *list*

```python theme={null}
# Get the property (read-only)
value = obj.Outputs
```
