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

# NSWorkflowGoal

> Carrier object for WorkflowGoal.

Carrier object for WorkflowGoal.

## Constructors

### NSWorkflowGoal()

```crmscript theme={null}
NSWorkflowGoal
```

Initializes a new instance of the NSWorkflowGoal class.

## Methods

## GetWorkflowGoalId()

Gets the primary key (ID) for the WorkflowGoal.

```crmscript theme={null}
Integer GetWorkflowGoalId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - WorkflowGoal Id.

## SetWorkflowGoalId(Integer)

Sets the primary key (ID) for the WorkflowGoal.

```crmscript theme={null}
Void SetWorkflowGoalId(Integer workflowGoalId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## GetWorkflowId()

Gets the ID of the flow this goal belongs to.

```crmscript theme={null}
Integer GetWorkflowId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Workflow ID.

## SetWorkflowId(Integer)

Sets the ID of the flow this goal belongs to.

```crmscript theme={null}
Void SetWorkflowId(Integer workflowId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## GetGoalType()

Gets the workflow goal type.

```crmscript theme={null}
NSWorkflowGoalType GetGoalType()
```

**Returns:** [CRMScript.NetServer.NSWorkflowGoalType](CRMScript.NetServer.NSWorkflowGoalType) - Goal type.

## SetGoalType(NSWorkflowGoalType)

Sets the workflow goal type.

```crmscript theme={null}
Void SetGoalType(NSWorkflowGoalType goalType)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## GetRestrictionGroups()

Gets the restrictions (can be multiple groups) that make up the Workflow goal criteria.

```crmscript theme={null}
NSArchiveRestrictionGroup[] GetRestrictionGroups()
```

**Returns:** [CRMScript.NetServer.NSArchiveRestrictionGroup](CRMScript.NetServer.NSArchiveRestrictionGroup)\[] - Array of restriction groups.

## SetRestrictionGroups(NSArchiveRestrictionGroup\[])

Sets the restrictions that make up the Workflow goal criteria.

```crmscript theme={null}
Void SetRestrictionGroups(NSArchiveRestrictionGroup[] restrictionGroups)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)


## Related topics

- [NSWorkflowAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSWorkflowAgent.md)
- [workflow_goal table](/en/database/tables/workflow-goal.md)
- [Delete Workflow Goal](/en/api/reference/restful/agent/workflow_agent/delete-workflow-goal.md)
- [Save Workflow Goal](/en/api/reference/restful/agent/workflow_agent/save-workflow-goal.md)
- [Get Workflow Goal](/en/api/reference/restful/agent/workflow_agent/get-workflow-goal.md)
- [Create Default Workflow Goal](/en/api/reference/restful/agent/workflow_agent/create-default-workflow-goal.md)
