**Source URL:** https://general.veevavault.dev/qualityone/vault-sdk/entry-points/actions/record-workflow-actions.md

# Record Workflow Actions



Record workflow actions are custom actions which execute on an object or document workflow. Document workflows are a type of object workflow which are configured on the `envelope__sys` object.

<Aside type="note" title="Note">The Vault Java SDK does not support [legacy workflows](https://platform.veevavault.help/en/gr/5205).

</Aside>
If you are unfamiliar with object or document workflows, you should learn more before coding a record workflow action:

* [Vault Help: Configuring Object Workflows](https://platform.veevavault.help/en/gr/33550)

* [Vault Help: Configuring Document Workflows](https://platform.veevavault.help/en/gr/50498)

You can configure a custom action for object workflows on any of the following steps:

* **Start step**: Actions configured against the *Participants* control. This action can include logic to populate the workflow participants. Note that if participants are populated through the SDK, Vault users cannot add participants to active workflows.

* **Task step**: Actions which are automatically invoked when a workflow task reaches a specified task event. For example, immediately after completion or cancellation of a task instance. Learn more about available events in the `WorkflowEvent` Enum in the [Javadocs](http://repo.veevavault.com).

Once configured on a workflow step, the record workflow action is automatically invoked on all events for that workflow step during workflow execution.

You cannot start a workflow, create tasks, and cancel the new tasks in the same transaction. For example, you cannot start a workflow and then cancel all tasks in a `TASK_AFTER_CREATE` event.

## Implementing Record Workflow Actions {#implementing-record-workflow-actions}

A record workflow action is a Java class that implements the `RecordWorkflowAction` interface and has the `@RecordWorkflowActionInfo` annotation.

The `RecordWorkflowAction` interface must implement the `execute()` method. This is where you place the logic for your custom action. You can use any of the available Java SDK services to create logic for your action. For example:

* `WorkflowInstanceService`: Update workflow participants

* `WorkflowTaskService`: Cancel workflow tasks

* `NotificationService`: Send notifications to workflow participants

* `RecordService`: Create related records

* `JobService`: Begin a related workflow. Note that you can only start workflows where the *Participants* control set to **Use roles as participants**.

Unlike record actions or document actions, the `RecordWorkflowAction` interface does not include an `isExecutable()` method. This means all record workflow actions are available for configuration once deployed. If you want to enable or disable a deployed record workflow action, you can do so in the UI or through [Vault API](/vault-api/api-reference/26.1/managing-vault-java-sdk/enable-vault-extension).

The `@RecordWorkflowActionInfo` annotation has the following elements:

* `label`: Label of the action. This is the label which appears for Vault Admins when configuring this action.

* `object`: If specified, the action is only available for object workflows associated to the specified object. To make this action available for document workflows, set this to the `envelope__sys` object. If omitted, the action is available across all object and document workflows.

* `stepTypes`: The workflow step types that this action can be configured against.

The following is a basic skeleton of a record workflow action:

```
package com.veeva.vault.custom.actions;

        @RecordWorkflowActionInfo(label="Custom Approver", stepTypes={WorkflowStepType.START})
        public class CustomApprover implements RecordWorkflowAction {
            public void execute(RecordWorkflowActionContext context) {
                //action logic goes here
            }
        }

```


---

**Previous:** [Record Actions](/qualityone/vault-sdk/entry-points/actions/record-actions)  
**Next:** [Document Actions](/qualityone/vault-sdk/entry-points/actions/document-actions)