# WorkflowParallelBranch

Source: /tuil/docs/reference/packages/workflow/api/workflow-parallel-branch
Locale: en

interface exported by @mwillbanks/tuil-workflow.



{/* Generated by tooling/docs/generate-reference.ts. */}

## interface [#interface]

Public interface exported by `@mwillbanks/tuil-workflow`.

```ts
export interface WorkflowParallelBranch<TState> {
  readonly id: string;
  readonly run: (
    context: WorkflowContext<TState>,
  ) => unknown | Promise<unknown>;
  readonly compensate?: (
    context: WorkflowContext<TState>,
  ) => void | Promise<void>;
}
```

## Members [#members]

| Member       | Type                                                                         | Required | Description                                                                                                             | Related types                                                               |
| ------------ | ---------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `id`         | `string`                                                                     | Yes      | The `id` member uses the `string` contract.                                                                             | —                                                                           |
| `run`        | `(context: WorkflowContext<TState>) => unknown \| Promise<unknown>`          | Yes      | The `run` member uses the `(context: WorkflowContext<TState>) => unknown \| Promise<unknown>` contract.                 | [`WorkflowContext`](/tuil/docs/reference/packages/workflow/api/workflow-context) |
| `compensate` | `((context: WorkflowContext<TState>) => void \| Promise<void>) \| undefined` | No       | The `compensate` member uses the `((context: WorkflowContext<TState>) => void \| Promise<void>) \| undefined` contract. | [`WorkflowContext`](/tuil/docs/reference/packages/workflow/api/workflow-context) |

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`WorkflowContext`](/tuil/docs/reference/packages/workflow/api/workflow-context)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/workflow/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-workflow](/tuil/docs/reference/packages/workflow)
