---
title: Creating custom action workflow steps
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** **Enterprise license required**
>
> Features described on this page require the **Kentico Xperience Enterprise** license.

Xperience enables developers to create custom actions that can be incorporated into [advanced workflow processes](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-workflows/designing-advanced-workflows.md). The procedure consists of two steps – writing the code of the action and registering the action into the system.

## Writing actions

1. Create a new class and make it inherit from **DocumentWorkflowAction** (available in the _CMS.DocumentEngine_ namespace).

   > **Tip:** **Class location**
   >
   > Add the class into a custom assembly (_Class Library_ project) within your Xperience administration solution. Add the appropriate references between the assembly and the main Xperience project.
2. Override the **Execute** method (available from the _DocumentWorkflowAction_ base class).
3. Write the code that you want to be executed into the _Execute_ method's body.

Action steps can have parameters (settings) specified that you can use to modify their behavior. Users can then enter values for the parameters when configuring an action step in the workflow designer.

If you want your custom action step to rely on parameters, you can specify them on the **Actions** tab of the **Workflows** application. To access the parameter's values in the code of an action, use the **GetResolvedParameter** method.

To access the data of the page going through the action step, use the **Node** property and its members (available from the _DocumentWorkflowAction_ base class).

```csharp

using CMS.DocumentEngine;

public class CustomAction : DocumentWorkflowAction
{
    public override void Execute()
    {
        // Gets the parameter value or assigns a default value - an empty string
        string appendText = GetResolvedParameter("MyParameter", "");

        // Appends the parameter value to the name of the page
        Node.DocumentName += appendText;

        // Saves the changes into the database
        Node.Update();
    }
}

```

## Registering actions in the system

1. Open the **Workflows** application.
2. Select the **Actions** tab.
3. Click **New action**.
4. Fill in the following mandatory fields:
   - **Display name** – name of the action step.
   - **Action provider - Assembly name** – name of the library (assembly) that contains the action's code.
   - **Action provider - Class** – full name of the class that contains the action's code (including namespaces).
5. Click **Save**.
6. (Optional) Define the action's parameters on the **Parameters** tab.
