Using Process Parameters
Process parameters allow you to store value and information of any type – whether it be numbers, text, or files. Using parameters intelligently will allow you to easily customize and automate workflows in Symphona Flow.
In this tutorial, we’ll go over:
- What parameters are
- The types of parameters you’ll use in Symphona Flow
- How to set up input and default parameters
- How to set up parameter sets
- How to configure output parameters
Let’s dive in!
What Are Parameters?
A parameter is essentially a variable that can store some kind of defined value – numbers, text, emails, files, etc.
Parameters allow you to organize, store, and use important information when creating and automating workflows.
Parameters in Symphona have three fields:
- Name: it’s useful to give your parameters short, descriptive names so you know exactly what they are. Naming your parameters param1, param2, param3 will confuse you once you start automating workflows
- Type: you have the option for your parameter to store any kind of value, but it can be useful to specify what type of value a parameter should store.
- For example, if you have a parameter furnitureInventory that stores the amount of remaining furniture in storage, you want to store a number in it, not emails or text. To make things easy, you should give furnitureInventory the value type of Number.
- Value: this is where you store the value of your parameter. Depending upon whether it’s an input, default, or output parameter (we’ll go into what those are later), you might give the parameter a value yourself or have it receive or store a value later.
Suppose you ran a restaurant that sold burgers. We could create the following useful parameters in a process:
- burgerPrice (Type: Number): stores the current price of your burger
- pickleInventory (Type: Number): stores the current amount of pickles in storage
- ordersFulfilled (Type: File): output parameter that stores a file containing all orders fulfilled, including point-of-sale, amount paid, and date and time. Once the day is complete, a file is automatically generated and stored in ordersFulfilled
Types of Process Parameters
Flow has three types of parameters:
- Input parameters: these are parameters you set up before executing a workflow. When a process is being executed, it can use input parameters to store the outputs of expressions.
- A good mindset to have when designing input parameters is to think: what information does this process need to do its job? What parameters will Flow expect from me?
- For example, if you’re creating a workflow that automatically updates inventory based on successful order fulfillment, it’s probably a good idea to set up a totalInventory parameter that you and Symphona can use to store and modify the value of your remaining inventory.
- Default parameters: unlike input parameters, default parameters can store value before a workflow is executed. These can be useful for:
- Storing initial states
- Storing constants
- Having a parameter be always available for use, as input parameters' availability can vary
- Parameter sets: these are a collection of predefined parameters that can be shared and used across one or more processes.
- These are useful if you use certain parameters frequently and don’t want to define them each time for every new workflow you automate.
- Output parameters: these parameters store the output of expressions in a workflow.
- A simple example: if you have an Expression step that calculates 7 + 7, you can store the output of that expression (14) in an (either in a new parameter or an existing one, like an input or default parameter)
Let’s now go over where to find and configure input and default parameters.
Expected Input Parameters
In Flow’s Process Editor, go to the right and click on Settings. Under that, click Expected Input Parameters.
This will open up the initial parameters menu, where you can configure parameters that will be available for Flow to use before executing a process. You can add a new parameter within Input Parameters, Default Parameters, and Parameter Sets.
First, let’s go over how to set up input parameters.
Input Parameters
When you click on Add a New Parameter for Input Parameters, you’ll need to fill in the following fields.
- Parameter Name: set your parameter name (remember to give it a unique, descriptive name!)
- Expect Parameter Type: set your parameter type. The types supported by Symphona include:
- Text
- Anything
- Letters Only
- Letters and Numbers Only
- Numbers Only
- Address
- Full Address
- Postal Code (Canada)
- Zip Code (USA)
- Other
- Boolean
- Date
- File
- JSON
- Phone Number
- Required: toggle if this parameter is required
- Protected: toggle if this parameter is protected
You also have access to Advanced Configuration settings. For now, we won’t go into these.
Next, let’s look at how to configure default parameters.
Default Parameters
When you click on Add a New Parameter for Default Parameters, you’ll need to fill in the following fields.
- Parameter Name: set your parameter name
- Expect Parameter Type: set the parameter value type. The list is the same as those for Input Parameters.
- Parameter Value: set a parameter value based on your chosen parameter type
Parameter Sets
Clicking on Parameter Sets under the Settings tab in the Process Editor will take you to Symphona’s Back Office. From there, select Environments & Shared Parameter Sets.
From here, you can define both environments and parameter sets to share across one or more processes. We’ll go over how to define parameter sets.
Scroll down to the Parameter Sets section and click Create New Parameter Set on the top right.
From here, you can:
- Name and describe your parameter set
- Create parameters and define default values for them
- Create environment-specific parameters that override default parameters for specific environments
- You’ll need to choose the environment and the parameters you want to override from it
Output Parameters
There are many steps in the Process Editor that produce a value of some kind (e.g. a number, file, email ID, etc.), such as:
- Set Parameter Value
- Evaluate Expression
Steps like these will give you options for Output Configuration. In other words, Symphona is just asking you where you want to store this value. Here’s how to configure this. We’ll use the Set Parameter Value step as an example, but the fields you need for Output Configuration are the same across steps.
Once you click Add a New Parameter, you’ll need to fill out the following fields:
- Output Parameter (Target Parameter): choose whether the target parameter is an entirely new parameter or an existing parameter.
- If the parameter is new, you’ll need to give it a name.
- If the parameter is existing, you’ll be presented with a dropdown menu where you can pick existing workflow parameters to use (such as the input and default parameters you’ve created)
- Parameter Value: set a parameter value.
- Note: setting a parameter value for an existing parameter will replace any value it was storing. For example, if totalInventory was set at 50 but you set the parameter value in a Set Parameter Value step to 45, totalInventory will now be 45.
- Expect Parameter Type: choose the parameter type. For output parameters, the types supported are:
- ANYTHING
- NUMBER
- ALPHANUMERIC
- ALPHABET
- OBJECT
- GENERIC
- ADDRESS
- DATE_OF_BIRTH
- POSTAL_CODE
- ZIP_CODE
- PHONE_NUMBER
- BOOLEAN
Parameter Referencing with the @ Symbol
Within Symphona process steps, you can use the "@" symbol to dynamically reference parameters and data from previous steps in your workflow. This powerful feature enables you to create dynamic, data-driven processes that can pass information between steps seamlessly.
How Parameter Referencing Works
When you use the "@" symbol followed by a parameter name, Symphona automatically substitutes that reference with the actual value from the specified parameter at runtime. This allows you to build flexible workflows that adapt based on data collected or processed in earlier steps.
Syntax and Usage
The basic syntax for parameter referencing is:
@parameter_name
Simple Example: Mathematical Operations
If you have parameters containing numbers like @score1, @score2, and @score3, you can calculate their average using JavaScript:
(@score1 + @score2 + @score3) / 3
This expression will automatically substitute the parameter values and calculate the result. For example, if the parameters contain 85, 92, and 78, the result would be 85.
Advanced Example: Database Query Results
Consider a SQL query that retrieves job information:
SELECT *
FROM "custom_data"."job_extract"
WHERE work_order_id = 'Call_ID'
ORDER BY job_id DESC
LIMIT 1;If this query has an output parameter called jsonDataJobExtract, you can reference specific fields from the query results using JSON path syntax:
{JSON_PATH:$[0].agent_skill_required}@jsonDataJobExtract
In this example:
- @jsonDataJobExtract references the output parameter from the SQL query step
- JSON_PATH:$[0].agent_skill_required extracts the agent_skill_required field from the first row of results
- The blue highlighting in the interface indicates recognized parameter references
JavaScript Integration with Nashorn
Symphona's "Set New Parameter Value" and "Evaluate Expression" tiles use the Nashorn JavaScript engine, which means you can treat parameters as JavaScript variables and manipulate them using standard JavaScript syntax and functions. This enables powerful data transformation and logic operations within your processes.
JavaScript Parameter Manipulation
Since parameters function as JavaScript variables, you can:
- Perform mathematical operations: @numberParam + 10 or (@value1 + @value2) / 2
- String manipulation: @textParam.toUpperCase()
- Conditional logic: @statusParam === 'active' ? 'proceed' : 'stop'
- Array operations: @arrayParam.length
That’s everything you need to know about Flow process parameters!
- Using Process Parameters
- What Are Parameters?
- Types of Process Parameters
- Expected Input Parameters
- Input Parameters
- Default Parameters
- Parameter Sets
- Output Parameters
- Parameter Referencing with the @ Symbol
- How Parameter Referencing Works
- Syntax and Usage
- Simple Example: Mathematical Operations
- Advanced Example: Database Query Results
- JavaScript Integration with Nashorn
- JavaScript Parameter Manipulation