> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-workflow/extending/expanders.md).

# Workflow Expanders

Learn more about workflow Expanders and how they are implemented.

Workflow Expanders allow developers to capture additional data as part of a workflow submission. Expansion data is displayed in the workflow detail dialog, and can be accessed programmatically via Workflow notifications or custom code.

Implementing a Workflow Expander requires a C# class definition and a backoffice extension.

## Server-side implementation

The server-side implementation requires a C# class fulfilling the `IWorkflowExpander` interface:

```csharp
    public class DocumentWorkflowExpander : IWorkflowExpander
    {
        /// <summary>
        /// Defines the entity type associated with the workflow instance.
        /// This is the only required property.
        /// </summary>
        public string For => "document";

        public bool? Bar { get; set; }
    }
```

In this example, the Expander will be applied to document workflows. The `Bar` property has a corresponding property in the client-side implementation. The Expander can define multiple properties, and the example above includes a single property for simplicity.

The Expander does not require registration. Workflow builds a collection on startup, minimising developer work.

## Client-side implementation

The client-side implementation requires a backoffice extension of type `workflowExpansion`:

```typescript
{
    type: 'workflowExpansion',
    alias: "MyWorkflowExtensions.Expansion.Document",
    name: "Custom Workflow Document Workflow Expansion",
    entityType: UMB_DOCUMENT_ENTITY_TYPE,
    meta: {
        properties: [{
            alias: "bar",
            propertyEditorUiAlias: "Umb.PropertyEditorUi.Toggle",
            label: "A custom property",
            description: "It can have a description if required",
            validation: { mandatory: true },
            weight: 800,
            // include is passed the current workflow state and a boolean indicating the variation state of the current entity.
            // The function is optional and must return a boolean value.
            include: (args) => args.state?.allowScheduling && args.varies,
        }]
    }
}
```

The `workflowExpansion` type requires `meta.properties`, where `properties` is an array of expander definitions.

In this example, the `alias` matches a property from the C# class. The `propertyEditorUiAlias` can be any valid property editor, but ideally would be a basic editor such as a toggle, a text string, or similar.

The default properties in the workflow submit dialog are also registered using this extension-first approach.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/umbraco-workflow/extending/expanders.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
