Manual Workflow Parameters 🛠️

Overview

With the April 2023 update comes the ability to specify parameters for manual workflows, enabling the workflow to take input from the user that triggers it!

This new feature is currently only available in the Alloy API but will appear in Alloy Web soon (look out for it in upcoming release notes 👀).

Start by creating a design with the desired parameters represented as attributes. When you create the workflow, you can now specify your parameter design in the trigger model. You can then reference the parameters by their attribute codes when configuring the workflow's actions.

When you trigger the workflow, you can specify which parameters to use and supply any required values. Once the feature comes to Alloy Web, users will be prompted to enter values for all parameters defined by the parameter design when they trigger the workflow.

Parameters greatly increase the flexibility of workflows, to the point where a single workflow can now cater for multiple circumstances that previously required setting up multiple workflows. We look forward to seeing how you use them!

Who is affected?

This change provides new opportunities for workflow editors when designing and implementing manual workflows via the Alloy API.

Details

Here are the steps for setting up a manual workflow that takes parameters via the Alloy API.

Create a parameter design

  • Create a design that implements the designInterfaces_workflowManualTrigger interface.
  • Add an attribute for each parameter you plan to use.

Create a workflow

  • Create a workflow via the /api/workflow endpoint (Swagger/ReDoc).
  • For the trigger property, specify a WorkflowTriggerWebModelBase with a discriminator of ManualTrigger
  • For the parametersDesignCode property, enter the code of your parameter design.

Use a parameter in an action

  • Add an action via the /api/workflow/{code}/action endpoint (Swagger/ReDoc).
  • For the parameters property, specify an array containing at least one object with a discriminator of WorkflowComputedItemAttributeWebModel.
  • For the value property of the WorkflowComputedItemAttributeWebModel object, specify an object with a discriminator of WorkflowSyntaxNodeTriggerParameterWebModel.
  • For the parameterCode property of the WorkflowSyntaxNodeTriggerParameterWebModel object, specify the relevant attributeCode from your parameter design.

Trigger the workflow

  • Run the workflow via the /api/workflow/{code}/manual-run endpoint (Swagger/ReDoc).
  • For the triggerParameters property, specify the relevant attribute code from your parameter design and optionally provide a value.