# Workflow Management API

# Overview

The Workflow Management REST APIs allow the creation of a workflow, and steps within the workflow. Steps, and split step options must be assigned actions that are already defined through the Enrollment Actions API. Please see that API for additional information. For split steps only the action definition is to be provided, but the options require a matching action type, and must be of type split.

## Getting Started: Creating Workflows and Steps

### 1. Create a Workflow
To create a new workflow:
1. Use `POST /workflows` with required fields: `name`, `description`
2. Optionally specify `allowedIps` and `disAllowedIps` for network restrictions
3. The workflow will be created with a status of work in progress
4. Use `PATCH /workflows/{workflowId}` to update workflow properties

### 2. Create Steps
Steps define the user journey within a workflow:
1. **Start Step**: Use `POST /workflows/{workflowId}/steps` to create the initial step
2. **Regular Steps**: Create additional steps using `POST /workflows/{workflowId}/steps/{stepId}`
3. **Split Steps**: Create branching logic using split steps with multiple options
4. **End Steps**: Mark steps as terminating to end the workflow

### 3. Assign Actions to Steps
Each step requires an action definition:
1. Query available actions using `GET /workflowActionDefinitions`
2. Assign action by setting `actionDefinitionId` in the step
3. For split steps, create options using `POST /workflows/{workflowId}/steps/{stepId}/splitOptions`
4. Each split option must have a matching action type

### 4. Connect Steps in Sequence
Link steps together to create the workflow flow:
1. Set `nextStepId` to connect steps in sequence
2. Use `POST /workflows/{workflowId}/steps/{stepId}/nextSteps/{detachedStepId}` to attach steps
3. For split steps, each option can lead to different next steps

### 5. Publish the Workflow
Make the workflow available to users:
1. Use `PATCH /workflows/{workflowId}` with `publishedDetails.status: 'PUBLISHED'`
2. The workflow must be valid before publishing
3. Published workflows can be assigned to captive portal networks

Version: 0.0.4
License: RUCKUS Cloud Privacy Policy

## Servers

RUCKUS One API host for North American region.
```
https://api.ruckus.cloud
```

RUCKUS One API host for European region.
```
https://api.eu.ruckus.cloud
```

RUCKUS One API host for Asian region.
```
https://api.asia.ruckus.cloud
```

## Download OpenAPI description

 - [Workflow Management API](https://docs.ruckus.cloud/_bundle/api/workflow-api-0.0.4_1.yaml)

## Workflow

 - [PUT /workflows/{workflowId}/steps/{stepId}/splitOptions/{optionId}/nextSteps/workflows/{referencedWorkflowId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/referencesplitoptiontoworkflow.md): Creates an external workflow reference step after the specified split option in a workflow. This links a branch path to another workflow by reference without cloning its steps. The workflow cannot ref
 - [PUT /workflows/{workflowId}/steps/{stepId}/nextSteps/workflows/{referencedWorkflowId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/referencesteptoworkflow.md): Creates an external workflow reference step after the specified step in a workflow. The referenced workflow is linked by reference only; its steps are not copied into the parent workflow. The workflow
 - [POST /workflows/{workflowId}/steps/{stepId}/nextSteps/workflows/{referencedWorkflowId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/nestedcloneworkflow.md): Imports an existing workflow as a nested workflow within the current workflow, creating a hierarchical workflow structure. This operation clones the referenced workflow and inserts all of that workflo
 - [POST /workflows](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/createworkflow.md): Creates a new workflow with the specified configuration and automatically initializes it with start and end steps. This operation accepts a workflow data object containing the workflow name, descripti
 - [POST /workflows/{workflowId}/workflows](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/cloneworkflow.md): Creates a complete copy of an existing workflow including all its steps, split options, and configuration. The cloned workflow will have a new unique ID and a name generated by appending 'Clone' to th
 - [POST /workflows/{workflowId}/versions/query](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/queryforversionedworkflows.md): Retrieves all published versions of a specific workflow, including the original workflow and all its published iterations. This endpoint returns a paginated list of workflow versions that share the sa
 - [POST /workflows/{workflowId}/referencedWorkflows/query](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/queryforreferencingworkflows.md): Retrieves workflows that reference the specified workflow as an external workflow reference.
 - [POST /workflows/query](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/queryforworkflows.md): Retrieves all of the work in progress workflows based on the query criteria.
 - [GET /workflows/{workflowId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/getworkflowbyid.md): Retrieves the requested workflow by id.
 - [DELETE /workflows/{workflowId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/deleteworkflow.md): Initiates a request that will delete the workflow requested. If the workflow id provided is for a workflow that is in a work in progress state then it will be deleted along with all dependent publishe
 - [PATCH /workflows/{workflowId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/workflow/updateworkflow.md): Updates an existing workflow with new configuration values including name, description, network restrictions (allowedIps/disAllowedIps), and publication status. This operation supports partial updates
## Steps

 - [PUT /workflows/{workflowId}/workflows/{referencedWorkflowId}/endSteps/{refWorkflowEndStep}/nextSteps/{detachedStepId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/attachstepstoreferenceworkflow.md): Attach an existing detached step after the end step of a referenced workflow. Use workflowId for the parent workflow, referencedWorkflowId for the nested referenced workflow, refWorkflowEndStep for th
 - [PUT /workflows/{workflowId}/steps/{stepId}/nextSteps/{detachedStepId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/attachsteps.md): Attach a detached step to an existing step in the workflow. This operation takes a step that is currently disconnected from the workflow flow and connects it as the next step after the specified paren
 - [POST /workflows/{workflowId}/workflows/{referencedWorkflowId}/endSteps/{refWorkflowEndStep}/nextSteps](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/createchildsteptoreferencedworkflow.md): Creates a new step that continues the flow after the end step of a referenced workflow within a parent workflow. Use workflowId to identify the parent workflow being edited and referencedWorkflowId to
 - [POST /workflows/{workflowId}/steps/{stepId}/nextSteps](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/createchildstep.md): Creates a new step in the workflow that will be executed after the specified parent step. This operation allows you to add sequential steps to the workflow flow, including regular steps, split steps,
 - [POST /workflows/{workflowId}/steps/query](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/queryforstepsassignedtothisworkflow.md): Searches and retrieves workflow steps using advanced query criteria. This endpoint supports complex filtering by step properties (ID, action definition, step type, termination status), custom sorting
 - [GET /workflows/{workflowId}/steps](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/getallstepsforworkflow.md): Retrieves the complete list of steps for the workflow with paging.
 - [GET /workflows/{workflowId}/steps/{stepId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/getstepbyid.md): Retrieves detailed information about a specific workflow step by its unique identifier. Returns complete step data including step type, action definitions, navigation relationships (prior/next steps),
 - [DELETE /workflows/{workflowId}/steps/{stepId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/deletestepv2.md): Deletes the requested step and leaves the previous and next steps disconnected. If this is a split, all options except the first will be removed. The step under the first option will be moved to the c
 - [DELETE /workflows/{workflowId}/steps/{stepId}/descendantSteps](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/steps/deletedescendantsteps.md): Deletes all steps that are descendants of the specified step, effectively truncating the workflow at that point. This operation removes all steps that follow the specified step in the workflow sequenc
## Split Options

 - [GET /workflows/{workflowId}/steps/{stepId}/splitOptions](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/split-options/getallsplitstepoptionsforstep.md): Retrieves all of the split options for the split step.
 - [POST /workflows/{workflowId}/steps/{stepId}/splitOptions](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/split-options/createoption.md): Creates a new split option for a split step, defining a branching path in the workflow. A split option represents a conditional branch that users can take based on the evaluation of an enrollment acti
 - [POST /workflows/{workflowId}/steps/{stepId}/splitOptions/{optionId}/nextSteps](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/split-options/createnextstepforoption.md): Creates a new step that will be executed when a specific split option is selected by the user. This operation allows you to define the workflow path that follows a particular split option. If no step
 - [GET /workflows/{workflowId}/steps/{stepId}/splitOptions/{optionId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/split-options/getsplitstepoptionbyid.md): Retrieves the split option by id.
 - [DELETE /workflows/{workflowId}/steps/{stepId}/splitOptions/{optionId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/split-options/deletesplitoption.md): Deletes the requested option and all of the steps under this option.
## Enrollment UI Configuration

 - [GET /workflows/{workflowId}/uiConfigurations](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/enrollment-ui-configuration/getuiconfiguration.md): Retrieves the UI configuration for the specified workflow.
 - [POST /workflows/{workflowId}/uiConfigurations](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/enrollment-ui-configuration/createuiconfig.md): Initiates a request that will update the workflows UI configuration.
 - [DELETE /workflows/{workflowId}/uiConfigurations](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/enrollment-ui-configuration/resetuiconfig.md): Deletes the custom settings on the UI configuration.
 - [GET /workflows/{workflowId}/uiConfigurations/{imageType}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/enrollment-ui-configuration/getimagefile.md): Get UI configuration's image for the specified workflow and image type.
## Action Definition

 - [POST /workflowActionDefinitions/query](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/action-definition/queryforactiondefinitions.md): Returns the list of action definitions using the specified query.
 - [GET /workflowActionDefinitions](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/action-definition/getallactions.md): Retrieves the complete list of action definitions with paging.
 - [GET /workflowActionDefinitions/{definitionId}](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/action-definition/getbydefinitionid.md): Retrieves the requested action definition by id.
 - [GET /workflowActionDefinitions/{definitionId}/requiredPriorDefinitions](https://docs.ruckus.cloud/api/workflow-api-0.0.4_1/action-definition/getrequiredpriordefinitions.md): Retrieves the list of required prior actions for this action.
