Build workflows with activities in Studio

Create Sequence, Flowchart and State Machine workflows, add and configure activities, invoke other workflows, handle errors and capture UI elements.

A workflow is a .xaml file in the VeloPhex XAML format. You build it on the canvas from activities: the built-in control-flow nodes, and the activities of the packages your project installs. Create a workflow# Press Ctrl + N, or on the Design ribbon tab open the New workflow menu and pick a kind. You can also right-click a folder in the Explorer and select New workflow…. Enter a Name, for example ProcessInvoices. Studio adds .xaml. Choose the Type: Sequence: activities one after another, top to bottom. Flowchart: steps connected by branches, with decisions and switches. State Machine: states and the transitions between them. Select Set as main workflow if Run project should start it. Select Create. Add an activity# Use any of these: In the Activities panel (Ctrl + Shift + A), find the activity and double-click it, press Enter, or drag it onto the canvas. Select an activity on the canvas and press Ctrl + Space (Add activity). Search in the picker and press Enter; the new activity goes after the selection. In a Sequence, select the + button between two activities. Search for the activity in the command palette (Ctrl + Shift + P). Find activities# The Activities panel groups activities by category, with Favorites and Recently used at the top. Search matches the name, category, package and keywords; every word you type must match. From the filter menu you can show Project packages or Favorites only, or turn on Search by description. The panel menu switches to Group by package or No grouping (A–Z). To add an activity to Favorites, select the star on its row. Activities that need no package# These are always available, even with no package installed: Sequence, If, Switch, While, Do While, For Each, Parallel, Parallel For Each, Pick, Trigger Scope, Break, Continue, Flowchart, Flow Decision, Flow Switch, State Machine, State, Final State, Assign, Multiple Assign, Try Catch, Throw, Rethrow, Retry Scope, Compensable Scope, Cancellation Scope, Compensate, Delay, Wait For Event, Invoke Workflow, Invoke Code, Persist and Terminate Workflow. Everything else, such as Log Message, comes from activity packages. See Manage activity packages. Configure an activity# Select the activity and open Properties (F4). Fill in the properties. Required ones are marked with a red *, and the activity shows an error until they are set. Enter a value as an expression, for example "Invoice " + InvoiceNumber. Fields marked fx take expressions; select Open expression editor for more room. See Variables, arguments and expressions. Rows are grouped (Common, Input, Output, Options and so on). Advanced starts collapsed. Select the pin on a row (Show on card) to show that value on the activity's card. Right-click an activity on the canvas for more commands, including Rename (F2), Add annotation (Shift + F2), Disable (Ctrl + D), Move up and Move down (Alt + Up / Down), Surround with Try Catch and Activity help (F1). Edit a Flowchart# Drag from a node's output port to the node it leads to, or to empty canvas to add a new node there. A decision has True and False ports; a switch has one port per case and Add case. Right-click a node for Add step after… (Ctrl + Space), Connect to… (Ctrl + K) and Set as start. Right-click the canvas for Add decision here, Add switch here and Auto layout. Turn Show conditions on to see decision conditions on the canvas. Edit a State Machine# A new State Machine starts with an Initial state, a Final state and a transition between them. Right-click a state to Edit entry actions, Edit body or Edit exit actions, Add state after, Add transition to… (Ctrl + K) or Set as initial. Open a transition to set its Trigger, Condition and destination; right-click it for Edit action. Right-click the canvas for Add state here and Add final state here. Call another workflow with Invoke Workflow# Split large processes into several workflows and call them with Invoke Workflow. Add Invoke Workflow. In Properties > Workflow, pick the workflow from the project's list. Studio stores the workflow's ID, so renaming or moving the file keeps the link. Select Configure arguments on the card (or Configure… next to Arguments). Select Import arguments to add every argument the workflow declares. Then bind each In argument to a value or expression and each Out argument to a variable. Create variables creates the variables for you. Required arguments are marked with *. Select Open workflow on the card to edit the called workflow. Studio checks invocations when it validates: a missing workflow, an unknown argument or a missing required input is an error. Handle errors with Try Catch# Select the activities and press Ctrl + Shift + T (Surround with Try Catch), or add Try Catch and move activities into Try. A new Try Catch has one catch for System.Exception with the variable exception. Change the Exception type, or select Add catch for another type. More specific types should come first. Add the handling activities to each catch, for example a log message, or Rethrow. Optionally select Add Finally for steps that must always run. A Try Catch keeps at least one catch. Retry a step with Retry Scope# Use Retry Scope for steps that can fail for a short time, such as a slow web page. Add Retry Scope and put the steps in its Action. In Properties, set Maximum retries (default 3) and Retry interval (default 5 seconds). Optionally set Retry when, a Boolean expression. Capture UI elements# UI automation needs the VeloPhex.UIAutomation.Activities package. Until it is installed, the Object Repository panel offers Install UI Automation…. For browsers, set up the extension under Home > Tools > Browser extensions. To point a UI activity at an element: Add a UI activity, such as a click. See the Activity catalog for which scope it belongs in. On the activity's target, select Pick element (Ctrl + Alt + P). Hover over the element and click it. While picking, F2 pauses, F3 picks an image region, F6 switches to hover pick, and Esc cancels. Select Verify to check that the target finds the element. To refine it, select Edit target… in Properties: there you can Validate, Highlight, Add anchor… or Minimise and harden the target. To store elements for reuse across workflows, use the Object Repository panel: Open it from the command palette (Object Repository). Select Capture elements… and pick the elements one after another, then select Done. Drag an element from the repository onto the workflow, or select Add to workflow. Element Explorer, on the Design ribbon tab, shows the UI tree of windows and pages so you can build and test a target for a hard-to-reach element. Validate and fix problems# Studio validates as you edit. Problems appear on the activities and in the Error List (Ctrl + Shift + E). Double-click a row to go to the activity. F8 validates the open workflow and Shift + F8 the whole project. Ctrl + F8 jumps to the next problem on the canvas. Workflow Analyzer findings have codes that start with VXA. To choose which rules run and whether errors stop a run or a publish, open Project settings > Workflow Analyzer (or Analyzer rules in the Error List's menu). Next steps# Pass data between activities: Variables, arguments and expressions. Test your workflow: Run and debug workflows.

Create a workflow

Add an activity

Find activities

Activities that need no package

Configure an activity

Edit a Flowchart

Edit a State Machine

Call another workflow with Invoke Workflow

Handle errors with Try Catch

Retry a step with Retry Scope

Capture UI elements

Validate and fix problems

Next steps