# defineWorkflow

> API reference for defineWorkflow: parameters, properties, and return types.

Defines a workflow and its actions.

```ts
import { defineWorkflow } from '@rippling/rippling-sdk';
```

## Properties

| Property | Required | Type | Description |
| --- | --- | --- | --- |
| `apiName` | Required | `` `${string}__c` `` | — |
| `title` | Required | `string` | Workflow title shown to admins. |
| `trigger` | Required | `[WorkflowTrigger](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowTrigger-e0a9b94e)` | Trigger definition in the workflows v2 proto JSON shape. |
| `categories` | Optional | `[WorkflowCategory](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowCategory-aa571877)[]` | — |
| `customVariables` | Optional | `Record<string, [WorkflowCustomVariable](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowCustomVariable-483455d4)>` | — |
| `description` | Optional | `string` | Short workflow description shown to admins. |
| `function` | Optional | `string \| [FunctionReference](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FunctionReference-77f9d9d2)` | The function this workflow runs. Pass a live FunctionReference reference, or a raw api\_name string for functions defined outside this manifest. |
| `functionApiNamesByOldId` | Optional | `Record<string, string>` | — |
| `functionsInferredGraph` | Optional | `[WorkflowGraph](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowGraph-4aa77fe8)` | — |
| `graph` | Optional | `[WorkflowGraph](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowGraph-4aa77fe8)` | — |
| `recipeId` | Optional | `string` | — |
| `triggerStatus` | Optional | `[WorkflowTriggerStatus](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowTriggerStatus-00929d26)` | — |
| `versionStatus` | Optional | `[WorkflowVersionStatus](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/WorkflowVersionStatus-6a10c3ee)` | — |

[Complete options type](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefineWorkflowProps-4cc01648)

TypeScript signature

```ts
defineWorkflow(props: DefineWorkflowProps): Workflow;
```

## Returns

```
Workflow
```

## Availability

| Capability | Support |
| --- | --- |
| Pull into a project | Supported |
| Runtime operations | Not available for this helper |

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/defineWorkflow

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
