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

# SuperOffice.WebApi.Agents.IWorkflowAgent

# \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent">\</a> Interface IWorkflowAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Agent lets you configure workflow automation

```csharp theme={null}
public interface IWorkflowAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_AddAfterWorkflowStepAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_WorkflowStepBase\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AddAfterWorkflowStepAsync(int, WorkflowStepBase, RequestOptions)

Add another step (and any of its substeps) after the given step id (which must exist), and move any following steps in the workflow further down the line.

```csharp theme={null}
Task<WorkflowStepBase> AddAfterWorkflowStepAsync(int workflowStepId, WorkflowStepBase subStep, RequestOptions requestOptions = null)
```

#### Parameters

`workflowStepId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of WorkflowStep

`subStep` [WorkflowStepBase](SuperOffice.WebApi.Data.WorkflowStepBase.md)

The step to be inserted after given step id.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowStepBase](SuperOffice.WebApi.Data.WorkflowStepBase.md)\&gt;

The added step

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_ConnectEmailFlowContentAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ConnectEmailFlowContentAsync(int, int, RequestOptions)

Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.

```csharp theme={null}
Task ConnectEmailFlowContentAsync(int emailFlowId, int messageId, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The EmailFlow to connect the message to.

`messageId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The s\_message to connect to the flow. A shipment, form or flow may be connected to that s\_message.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CopyEmailFlowAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CopyEmailFlowAsync(int, string, RequestOptions)

Copy an email flow.

```csharp theme={null}
Task<int> CopyEmailFlowAsync(int emailFlowId, string newName, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The EmailFlow to copy.

`newName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the new email flow

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Newly created email flow id for this content

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CopyEmailFlowContentAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CopyEmailFlowContentAsync(int, int, RequestOptions)

Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.

```csharp theme={null}
Task<int> CopyEmailFlowContentAsync(int emailFlowId, int shipmentId, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The EmailFlow to connect the copied content to.

`shipmentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the shipment to copy to the flow. The message of this shipment will also be connected

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Newly created shipment id for this content

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultEmailFlowAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultEmailFlowAsync(RequestOptions)

Set default values into a new EmailFlow.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<EmailFlow> CreateDefaultEmailFlowAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EmailFlow](SuperOffice.WebApi.Data.EmailFlow.md)\&gt;

A blank EmailFlow

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowEventAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowEventAsync(RequestOptions)

Set default values into a new WorkflowEvent.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<WorkflowEvent> CreateDefaultWorkflowEventAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowEvent](SuperOffice.WebApi.Data.WorkflowEvent.md)\&gt;

A blank WorkflowEvent

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowEventResultAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowEventResultAsync(RequestOptions)

Set default values into a new WorkflowEventResult.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<WorkflowEventResult> CreateDefaultWorkflowEventResultAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowEventResult](SuperOffice.WebApi.Data.WorkflowEventResult.md)\&gt;

A blank WorkflowEventResult

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowFilterAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowFilterAsync(RequestOptions)

Set default values into a new WorkflowFilter.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<WorkflowFilter> CreateDefaultWorkflowFilterAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowFilter](SuperOffice.WebApi.Data.WorkflowFilter.md)\&gt;

A blank WorkflowFilter

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowGoalAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowGoalAsync(RequestOptions)

Set default values into a new WorkflowGoal.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<WorkflowGoal> CreateDefaultWorkflowGoalAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowGoal](SuperOffice.WebApi.Data.WorkflowGoal.md)\&gt;

A blank WorkflowGoal

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowStepFromTypeAsync\_SuperOffice\_WebApi\_Data\_WorkflowStepType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowStepFromTypeAsync(WorkflowStepType, RequestOptions)

Creates a new carrier from the step type given, with the right kind of properties, defaults set.

```csharp theme={null}
Task<WorkflowStepBase> CreateDefaultWorkflowStepFromTypeAsync(WorkflowStepType stepType, RequestOptions requestOptions = null)
```

#### Parameters

`stepType` [WorkflowStepType](SuperOffice.WebApi.Data.WorkflowStepType.md)

Step type to create

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowStepBase](SuperOffice.WebApi.Data.WorkflowStepBase.md)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowStepOptionFromTypeAsync\_SuperOffice\_WebApi\_Data\_WorkflowSplitOptionType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowStepOptionFromTypeAsync(WorkflowSplitOptionType, RequestOptions)

Creates a new carrier from the option type given, with the right kind of properties, defaults set.

```csharp theme={null}
Task<WorkflowStepOptionBase> CreateDefaultWorkflowStepOptionFromTypeAsync(WorkflowSplitOptionType optionType, RequestOptions requestOptions = null)
```

#### Parameters

`optionType` [WorkflowSplitOptionType](SuperOffice.WebApi.Data.WorkflowSplitOptionType.md)

Option type to create

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowStepOptionBase](SuperOffice.WebApi.Data.WorkflowStepOptionBase.md)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowTriggerAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowTriggerAsync(RequestOptions)

Set default values into a new WorkflowTrigger.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<WorkflowTrigger> CreateDefaultWorkflowTriggerAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowTrigger](SuperOffice.WebApi.Data.WorkflowTrigger.md)\&gt;

A blank WorkflowTrigger

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateDefaultWorkflowWaitForActionAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultWorkflowWaitForActionAsync(RequestOptions)

Set default values into a new WorkflowWaitForAction.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<WorkflowWaitForAction> CreateDefaultWorkflowWaitForActionAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowWaitForAction](SuperOffice.WebApi.Data.WorkflowWaitForAction.md)\&gt;

A blank WorkflowWaitForAction

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_CreateEmailFlowContentAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateEmailFlowContentAsync(int, string, RequestOptions)

Create content to an email flow

```csharp theme={null}
Task<int> CreateEmailFlowContentAsync(int emailFlowId, string contentName, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The EmailFlow to connect the created message to.

`contentName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The name of the content created

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Id of shipment created

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_DeleteEmailFlowAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteEmailFlowAsync(int, RequestOptions)

Deletes the EmailFlow

```csharp theme={null}
Task DeleteEmailFlowAsync(int emailFlowId, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the EmailFlow

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_DeleteWorkflowGoalAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteWorkflowGoalAsync(int, RequestOptions)

Deletes the WorkflowGoal

```csharp theme={null}
Task DeleteWorkflowGoalAsync(int workflowGoalId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowGoalId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the WorkflowGoal

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_DeleteWorkflowTriggerAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteWorkflowTriggerAsync(int, RequestOptions)

Deletes the WorkflowTrigger

```csharp theme={null}
Task DeleteWorkflowTriggerAsync(int workflowTriggerId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowTriggerId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the WorkflowTrigger

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_DeleteWorkflowWaitForActionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteWorkflowWaitForActionAsync(int, RequestOptions)

Deletes the WorkflowWaitForAction

```csharp theme={null}
Task DeleteWorkflowWaitForActionAsync(int workflowWaitForActionId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowWaitForActionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the WorkflowWaitForAction

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetEmailFlowAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailFlowAsync(int, RequestOptions)

Gets a specific EmailFlow object.

```csharp theme={null}
Task<EmailFlow> GetEmailFlowAsync(int emailFlowId, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the EmailFlow object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EmailFlow](SuperOffice.WebApi.Data.EmailFlow.md)\&gt;

EmailFlow

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetWorkflowFencingInfoAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowFencingInfoAsync(RequestOptions)

Get the current Workflow fencing status for the tenant

```csharp theme={null}
Task<FencingInfo> GetWorkflowFencingInfoAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FencingInfo](SuperOffice.WebApi.Data.FencingInfo.md)\&gt;

Current fencing status including count, maximum, and warning state

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetWorkflowGoalAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowGoalAsync(int, RequestOptions)

Gets a specific WorkflowGoal object.

```csharp theme={null}
Task<WorkflowGoal> GetWorkflowGoalAsync(int workflowGoalId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowGoalId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the WorkflowGoal object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowGoal](SuperOffice.WebApi.Data.WorkflowGoal.md)\&gt;

WorkflowGoal

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetWorkflowStepAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowStepAsync(int, RequestOptions)

Get Workflowstep by ID

```csharp theme={null}
Task<WorkflowStepBase> GetWorkflowStepAsync(int workflowStepId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowStepId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of WorkflowStep

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowStepBase](SuperOffice.WebApi.Data.WorkflowStepBase.md)\&gt;

The Workflow step

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetWorkflowStepOptionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowStepOptionAsync(int, RequestOptions)

Get WorkflowStepOption by ID

```csharp theme={null}
Task<WorkflowStepOptionBase> GetWorkflowStepOptionAsync(int workflowStepOptionId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowStepOptionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of WorkflowStep option

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowStepOptionBase](SuperOffice.WebApi.Data.WorkflowStepOptionBase.md)\&gt;

The Workflow step option

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetWorkflowTriggerAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowTriggerAsync(int, RequestOptions)

Gets a specific WorkflowTrigger object.

```csharp theme={null}
Task<WorkflowTrigger> GetWorkflowTriggerAsync(int workflowTriggerId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowTriggerId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the WorkflowTrigger object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowTrigger](SuperOffice.WebApi.Data.WorkflowTrigger.md)\&gt;

WorkflowTrigger

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_GetWorkflowWaitForActionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowWaitForActionAsync(int, RequestOptions)

Gets a specific WorkflowWaitForAction object.

```csharp theme={null}
Task<WorkflowWaitForAction> GetWorkflowWaitForActionAsync(int workflowWaitForActionId, RequestOptions requestOptions = null)
```

#### Parameters

`workflowWaitForActionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the WorkflowWaitForAction object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowWaitForAction](SuperOffice.WebApi.Data.WorkflowWaitForAction.md)\&gt;

WorkflowWaitForAction

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_RemoveParticipantsFromEmailFlowAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveParticipantsFromEmailFlowAsync(int, int\[], RequestOptions)

Remove participants (actually workflow instances) from the workflow

```csharp theme={null}
Task RemoveParticipantsFromEmailFlowAsync(int emailFlowId, int[] workflowInstanceIds, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of EmailFlow

`workflowInstanceIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

Array of Workflow instances (representing participants) to be completely removed from the workflow

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_RunAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RunAsync(RequestOptions)

Run the workflow engine right now

```csharp theme={null}
Task<DateTime> RunAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)\&gt;

Suggested time for next run

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_SaveEmailFlowAsync\_SuperOffice\_WebApi\_Data\_EmailFlow\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveEmailFlowAsync(EmailFlow, RequestOptions)

Updates the existing EmailFlow or creates a new EmailFlow if the id parameter is 0.

```csharp theme={null}
Task<EmailFlow> SaveEmailFlowAsync(EmailFlow emailFlow, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlow` [EmailFlow](SuperOffice.WebApi.Data.EmailFlow.md)

The EmailFlow that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EmailFlow](SuperOffice.WebApi.Data.EmailFlow.md)\&gt;

New or updated EmailFlow

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_SaveWorkflowGoalAsync\_SuperOffice\_WebApi\_Data\_WorkflowGoal\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveWorkflowGoalAsync(WorkflowGoal, RequestOptions)

Updates the existing WorkflowGoal or creates a new WorkflowGoal if the id parameter is 0.

```csharp theme={null}
Task<WorkflowGoal> SaveWorkflowGoalAsync(WorkflowGoal workflowGoal, RequestOptions requestOptions = null)
```

#### Parameters

`workflowGoal` [WorkflowGoal](SuperOffice.WebApi.Data.WorkflowGoal.md)

The WorkflowGoal that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowGoal](SuperOffice.WebApi.Data.WorkflowGoal.md)\&gt;

New or updated WorkflowGoal

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_SaveWorkflowTriggerAsync\_SuperOffice\_WebApi\_Data\_WorkflowTrigger\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveWorkflowTriggerAsync(WorkflowTrigger, RequestOptions)

Updates the existing WorkflowTrigger or creates a new WorkflowTrigger if the id parameter is 0.

```csharp theme={null}
Task<WorkflowTrigger> SaveWorkflowTriggerAsync(WorkflowTrigger workflowTrigger, RequestOptions requestOptions = null)
```

#### Parameters

`workflowTrigger` [WorkflowTrigger](SuperOffice.WebApi.Data.WorkflowTrigger.md)

The WorkflowTrigger that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowTrigger](SuperOffice.WebApi.Data.WorkflowTrigger.md)\&gt;

New or updated WorkflowTrigger

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_SaveWorkflowWaitForActionAsync\_SuperOffice\_WebApi\_Data\_WorkflowWaitForAction\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveWorkflowWaitForActionAsync(WorkflowWaitForAction, RequestOptions)

Updates the existing WorkflowWaitForAction or creates a new WorkflowWaitForAction if the id parameter is 0.

```csharp theme={null}
Task<WorkflowWaitForAction> SaveWorkflowWaitForActionAsync(WorkflowWaitForAction workflowWaitForAction, RequestOptions requestOptions = null)
```

#### Parameters

`workflowWaitForAction` [WorkflowWaitForAction](SuperOffice.WebApi.Data.WorkflowWaitForAction.md)

The WorkflowWaitForAction that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowWaitForAction](SuperOffice.WebApi.Data.WorkflowWaitForAction.md)\&gt;

New or updated WorkflowWaitForAction

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_SendEventAsync\_SuperOffice\_WebApi\_Data\_WorkflowEvent\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SendEventAsync(WorkflowEvent, RequestOptions)

Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instance

```csharp theme={null}
Task<WorkflowEventResult> SendEventAsync(WorkflowEvent workflowEvent, RequestOptions requestOptions = null)
```

#### Parameters

`workflowEvent` [WorkflowEvent](SuperOffice.WebApi.Data.WorkflowEvent.md)

Information about the signaled event

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowEventResult](SuperOffice.WebApi.Data.WorkflowEventResult.md)\&gt;

Any relevant info about the event

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_SetStatusOnWorkflowAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_WorkflowDefinitionStatus\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetStatusOnWorkflowAsync(int, WorkflowDefinitionStatus, RequestOptions)

Set status on workflow, Run or pause flow

```csharp theme={null}
Task<WorkflowDefinitionStatus> SetStatusOnWorkflowAsync(int emailFlowId, WorkflowDefinitionStatus status, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the email flow to run or pause

`status` [WorkflowDefinitionStatus](SuperOffice.WebApi.Data.WorkflowDefinitionStatus.md)

The new status

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[WorkflowDefinitionStatus](SuperOffice.WebApi.Data.WorkflowDefinitionStatus.md)\&gt;

The new status

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_TryAddPersonsToEmailFlowAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TryAddPersonsToEmailFlowAsync(int, int\[], RequestOptions)

Try to add a participant to the EmailFlow. Same function available in PersonAgent

```csharp theme={null}
Task<bool[]> TryAddPersonsToEmailFlowAsync(int emailFlowId, int[] personIds, RequestOptions requestOptions = null)
```

#### Parameters

`emailFlowId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of EmailFlow

`personIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

Array of Person Ids

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\[]\&gt;

True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason

### \<a id="SuperOffice\_WebApi\_Agents\_IWorkflowAgent\_UpdateFormSubmissionsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UpdateFormSubmissionsAsync(int, RequestOptions)

Attempt to update stored field values for up to the given number of form submissions

```csharp theme={null}
Task<int> UpdateFormSubmissionsAsync(int maxCount, RequestOptions requestOptions = null)
```

#### Parameters

`maxCount` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The maximum number of form submissions to attempt to save as form field values.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Number of form submissions converted


## Related topics

- [SuperOffice.WebApi.Agents.WorkflowAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.WorkflowAgent.md)
- [WebAPI changes in SuperOffice 12.0](/release-notes/12/api/changes-webapi-12.0.342.0.md)
- [Add After Workflow Step](/en/api/reference/restful/agent/workflow_agent/add-after-workflow-step.md)
- [Get Workflow Step Option](/en/api/reference/restful/agent/workflow_agent/get-workflow-step-option.md)
