> 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

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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
