> ## 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.WorkflowAgent

# \<a id="SuperOffice\_WebApi\_Agents\_WorkflowAgent">\</a> Class WorkflowAgent

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

Agent lets you configure workflow automation

```csharp theme={null}
public class WorkflowAgent : AgentBase, IWorkflowAgent, IAgentBase, IDisposable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[AgentBase](SuperOffice.WebApi.Agents.AgentBase.md) ←
[WorkflowAgent](SuperOffice.WebApi.Agents.WorkflowAgent.md)

#### Implements

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

#### Inherited Members

[AgentBase.\_json](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__json),
[AgentBase.\_binary](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__binary),
[AgentBase.\_config](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__config),
[AgentBase.\_client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__client),
[AgentBase.\_disposeClient](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__disposeClient),
[AgentBase.Merge(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Merge_SuperOffice_WebApi_RequestOptions_),
[AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromStream_System_Net_Http_HttpMethod_System_String_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.ParseAuthorization(IAuthorization)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseAuthorization_SuperOffice_WebApi_Authorization_IAuthorization_),
[AgentBase.CancelRequest()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_CancelRequest),
[AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequest(HttpRequestMessage, RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequest_System_Net_Http_HttpRequestMessage_SuperOffice_WebApi_RequestOptions_),
[AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ThrowOnResponseErrorAsync_System_Net_Http_HttpRequestMessage_System_Net_Http_HttpResponseMessage_),
[AgentBase.ParseResponse\<T\&gt;(HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseResponse__1_System_Net_Http_HttpResponseMessage_),
[AgentBase.Finally(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Finally_SuperOffice_WebApi_RequestOptions_),
[AgentBase.Dispose()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Dispose),
[AgentBase.Configuration](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Configuration),
[AgentBase.Client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Client),
[AgentBase.HasRunningRequest](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_HasRunningRequest),
[AgentBase.ClientCancellationTokenSource](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ClientCancellationTokenSource),
[AgentBase.ProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ProgressListener),
[AgentBase.UploadProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_UploadProgressListener),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

\<pre>\<code class="lang-csharp">using SuperOffice.WebApi;
using SuperOffice.WebApi.Agents;

var mySession = new WebApiOptions("[http://example.com/super/api](http://example.com/super/api)");
mySession.Authorization = new AuthorizationUsernamePassword("user", "pass");
using (WorkflowAgent agent = new WorkflowAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

### \<a id="SuperOffice\_WebApi\_Agents\_WorkflowAgent\_\_ctor\_System\_Net\_Http\_HttpClient\_">\</a> WorkflowAgent(HttpClient)

Constructor: Agent lets you configure workflow automation

```csharp theme={null}
public WorkflowAgent(HttpClient httpClient)
```

#### Parameters

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Use this HTTP client instead of making own HttpClient instance.

### \<a id="SuperOffice\_WebApi\_Agents\_WorkflowAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> WorkflowAgent(WebApiOptions, HttpClient)

Constructor: Agent lets you configure workflow automation

```csharp theme={null}
public WorkflowAgent(WebApiOptions options, HttpClient httpClient = null)
```

#### Parameters

`options` [WebApiOptions](SuperOffice.WebApi.WebApiOptions.md)

Base URL and authentication values.

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Optional: Use this HTTP client instead of making a new one.

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_CopyEmailFlowAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CopyEmailFlowAsync(int, string, RequestOptions)

Copy an email flow.

```csharp theme={null}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_CreateEmailFlowContentAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateEmailFlowContentAsync(int, string, RequestOptions)

Create content to an email flow

```csharp theme={null}
public 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\_WorkflowAgent\_DeleteEmailFlowAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteEmailFlowAsync(int, RequestOptions)

Deletes the EmailFlow

```csharp theme={null}
public 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\_WorkflowAgent\_DeleteWorkflowGoalAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteWorkflowGoalAsync(int, RequestOptions)

Deletes the WorkflowGoal

```csharp theme={null}
public 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\_WorkflowAgent\_DeleteWorkflowTriggerAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteWorkflowTriggerAsync(int, RequestOptions)

Deletes the WorkflowTrigger

```csharp theme={null}
public 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\_WorkflowAgent\_DeleteWorkflowWaitForActionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteWorkflowWaitForActionAsync(int, RequestOptions)

Deletes the WorkflowWaitForAction

```csharp theme={null}
public 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\_WorkflowAgent\_GetEmailFlowAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEmailFlowAsync(int, RequestOptions)

Gets a specific EmailFlow object.

```csharp theme={null}
public 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\_WorkflowAgent\_GetWorkflowFencingInfoAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowFencingInfoAsync(RequestOptions)

Get the current Workflow fencing status for the tenant

```csharp theme={null}
public 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\_WorkflowAgent\_GetWorkflowGoalAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowGoalAsync(int, RequestOptions)

Gets a specific WorkflowGoal object.

```csharp theme={null}
public 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\_WorkflowAgent\_GetWorkflowStepAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowStepAsync(int, RequestOptions)

Get Workflowstep by ID

```csharp theme={null}
public 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\_WorkflowAgent\_GetWorkflowStepOptionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowStepOptionAsync(int, RequestOptions)

Get WorkflowStepOption by ID

```csharp theme={null}
public 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\_WorkflowAgent\_GetWorkflowTriggerAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowTriggerAsync(int, RequestOptions)

Gets a specific WorkflowTrigger object.

```csharp theme={null}
public 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\_WorkflowAgent\_GetWorkflowWaitForActionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetWorkflowWaitForActionAsync(int, RequestOptions)

Gets a specific WorkflowWaitForAction object.

```csharp theme={null}
public 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\_WorkflowAgent\_RemoveParticipantsFromEmailFlowAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RemoveParticipantsFromEmailFlowAsync(int, int\[], RequestOptions)

Remove participants (actually workflow instances) from the workflow

```csharp theme={null}
public 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\_WorkflowAgent\_RunAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RunAsync(RequestOptions)

Run the workflow engine right now

```csharp theme={null}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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\_WorkflowAgent\_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}
public 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.Data.WorkflowTrigger](/en/api/reference/webapi/SuperOffice.WebApi.Data.WorkflowTrigger.md)
- [SuperOffice.WebApi.Data.WorkflowEvent](/en/api/reference/webapi/SuperOffice.WebApi.Data.WorkflowEvent.md)
- [SuperOffice.WebApi.Data.WorkflowFilter](/en/api/reference/webapi/SuperOffice.WebApi.Data.WorkflowFilter.md)
- [SuperOffice.WebApi.Data.WorkflowGoal](/en/api/reference/webapi/SuperOffice.WebApi.Data.WorkflowGoal.md)
- [SuperOffice.WebApi.Agents.PersonAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.PersonAgent.md)
- [SuperOffice.WebApi.Agents.IPersonAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IPersonAgent.md)
