AltScore
Workflow Builder/User Guide

Working with Variables

Variables are the backbone of dynamic workflows. They allow data to flow between tasks, enabling you to build intelligent automation that responds to real-world inputs and conditions.

What are Variables

Variables are dynamic values that flow through your workflow during execution. Instead of hardcoding values into each task, you use variables to pass information from one step to another. This makes your workflows flexible, reusable, and capable of handling different scenarios without modification.

When a workflow executes, the system resolves all variable expressions at runtime, replacing them with actual values from the execution context.

Three Types of Variables

1. Input Variables (Workflow Parameters)

Input variables are parameters defined at the workflow level. They represent the initial data your workflow needs to start execution.

Characteristics:

  • Defined in the workflow settings before building
  • Values are provided when the workflow executes
  • Can have default values for optional parameters
  • Each variable has a name, type, and description

Common examples:

  • borrower_id - The identifier of a borrower to evaluate
  • loan_amount - The requested loan amount
  • application_date - When the application was submitted

Syntax:

{{workflow.variables.borrower_id}}
{{workflow.variables.loan_amount}}

Input variables define the contract between your workflow and its callers. Anyone executing your workflow must provide values for required input variables.

2. Source Variables (From AltData Enrichment)

Source variables contain data retrieved from external data sources through AltData Enrichment tasks. When you add an enrichment task to your workflow, it queries external services and makes the results available as variables.

Characteristics:

  • Created automatically by AltData Enrichment tasks
  • Contain data from credit bureaus, government registries, and other external sources
  • Available to all subsequent tasks in the workflow
  • Structure depends on the specific data source queried

Syntax:

{{nodes.enrich_task.outputs.source_data}}
{{nodes.credit_check.outputs.score}}

3. Created Variables (Computed Values)

Created variables are values you define within the workflow using Set Variable or Compute Variables tasks. These allow you to transform, combine, or calculate new values from existing data.

Characteristics:

  • Created by Set Variable or Compute Variables tasks
  • Can contain static values, calculations, or transformations
  • Useful for intermediate calculations and data formatting
  • Help organize complex logic into manageable pieces

Examples:

  • Calculating a debt-to-income ratio from fetched data
  • Formatting a name by combining first and last name fields
  • Creating a flag based on business rules

Managing Variables

Opening the Elements Panel

Variables are managed through the Elements Panel at the bottom of the canvas:

  1. Locate the Elements Panel at the bottom of the workflow canvas
  2. Click on the Variables tab to see all workflow variables
  3. The panel displays input variables, source variables, and created variables

Adding Input Variables

To add a new input variable:

  1. Open the Elements Panel and select Variables
  2. Click the Add Variable button
  3. Configure the variable properties:
    • Name: A unique identifier (use snake_case, e.g., borrower_id)
    • Type: The data type (string, number, boolean, object, array)
    • Default Value: Optional value used if none is provided
    • Description: Help text explaining the variable's purpose

Use clear, descriptive names for your variables. Names like borrower_id or loan_amount are much better than id or amount because they clearly indicate what data the variable holds.

Editing and Deleting Variables

  • Click on any variable in the list to edit its properties
  • Use the delete button to remove variables no longer needed
  • Changes to variables may require updates to tasks that reference them

Using Variables in Tasks

The Advanced Tab

Most task configuration happens in the Properties Panel. To map variables to task inputs:

  1. Select a task on the canvas
  2. Open the Properties Panel on the right side
  3. Navigate to the Advanced tab
  4. Find the input field you want to configure
  5. Enter a variable expression or use the variable picker

Variable Picker

The variable picker provides a visual way to select variables:

  1. Click the variable icon next to an input field
  2. Browse available variables organized by source
  3. Click a variable to insert its expression
  4. The picker shows the variable type and current value (if available)

Manual Expression Entry

You can also type variable expressions directly:

{{workflow.variables.borrower_id}}
{{nodes.fetch_data.outputs.response.name}}

Variable expressions must match exactly. A typo in the variable name or path will cause the workflow to fail at runtime. Always verify your expressions using the variable picker when possible.

Variable Syntax Reference

Workflow Input Variables

Access input variables defined at the workflow level:

{{workflow.variables.VARIABLE_NAME}}

Examples:

{{workflow.variables.borrower_id}}
{{workflow.variables.loan_amount}}
{{workflow.variables.application_type}}

Task Outputs

Access the output produced by a previous task using its alias:

{{nodes.TASK_ALIAS.outputs.OUTPUT_NAME}}

Examples:

{{nodes.credit_check.outputs.score}}
{{nodes.fetch_borrower.outputs.data}}
{{nodes.calculate_risk.outputs.risk_level}}

Nested Paths

Access nested properties within complex objects using dot notation:

{{nodes.TASK_ALIAS.outputs.data.user.name}}
{{nodes.TASK_ALIAS.outputs.response.items[0].value}}

Examples:

{{nodes.fetch_data.outputs.response.borrower.address.city}}
{{nodes.enrich.outputs.source_data.credit_history.accounts[0].balance}}

Task Inputs (For Debugging)

Access the input values that were passed to a task:

{{nodes.TASK_ALIAS.inputs.INPUT_NAME}}

This is primarily useful for debugging to verify what values a task received.

Practical Walkthrough: Creating and Using Variables

Let's walk through a real example together. By the end, you'll understand how to create a variable, use it in your workflow, and pass information between tasks.

The Scenario

Imagine you're building a workflow to look up customer information. You want the workflow to:

  1. Accept a customer ID when it runs
  2. Look up that customer's details
  3. Save the customer's name for use later in the workflow

This is a common pattern - you tell the workflow which customer to work with, and it handles the rest automatically.

Step 1: Create Your Input Variable

First, let's create a variable that will hold the customer ID.

  1. Look at the bottom of your canvas and find the Elements Panel
  2. Click on it to expand it, then select the Variables tab
  3. Click the Add Variable button
  4. Fill in the form:
    • Name: Enter customer_id (use underscores instead of spaces)
    • Type: Choose "string" from the dropdown
    • Description: Enter something helpful like "The ID of the customer to look up"
  5. Click the checkmark to save

You'll see your new variable appear in the list. This variable is like a placeholder - when someone runs the workflow, they'll provide the actual customer ID, and the workflow will use that value.

Step 2: Use the Variable in a Task

Now let's use this variable. We'll add a task that fetches customer data.

  1. Drag an HTTP Request task onto your canvas
  2. Click on the task to open the Properties Panel on the right
  3. Find the URL field and click inside it
  4. Here's where the magic happens: click the variable icon (it looks like {x}) next to the field
  5. A picker window opens showing all available variables
  6. Look under Workflow Variables and click on customer_id
  7. The variable appears in your URL field, surrounded by curly braces

The URL might now look something like:

https://api.example.com/customers/{{workflow.variables.customer_id}}

Those curly braces tell the workflow: "When you run, replace this with the actual customer ID."

Step 3: Pass Data to the Next Task

When the HTTP task runs, it will return the customer's information. Let's grab the customer's name from that response.

  1. Add a Set Variable task to the canvas (you'll find it in the Utilities category)
  2. Draw a connection from your HTTP task to this new task
  3. Click on the Set Variable task to configure it
  4. For Variable Name, enter customer_name
  5. For the Value, click the variable icon again
  6. This time, look under Task Outputs - you'll see your HTTP task listed
  7. Expand it and navigate through the data until you find the name field
  8. Click to select it

The variable picker makes this easy because it shows you exactly what data is available from previous tasks.

Step 4: Test It Out

Let's make sure everything works:

  1. Click the Play button to run a test
  2. A form appears asking for your input variable - enter a real customer ID
  3. Click Execute and watch your workflow run
  4. Click on each task to see what happened:
    • Check the HTTP task to see the URL that was used (your customer ID should be in there)
    • Check the Set Variable task to see the customer name that was captured

Tips for Success

Use the variable picker whenever possible. It shows you exactly what's available and helps you avoid typing mistakes. Manually typing variable names is the most common source of errors.

Check the Preview tab when debugging. If something isn't working, click on a task and look at the Preview tab. It shows you exactly what data that task produced, which helps you understand what paths are available.

Give your variables clear names. Names like customer_id and loan_amount are much easier to work with than id or amt. When you come back to edit the workflow later, you'll thank yourself.

If you're not sure what data a task produces, run the workflow once with test data. Then click on the task and check the Preview tab to see the actual results. This makes it much easier to find the right variable paths.

Best Practices

Naming Conventions

  • Use snake_case for variable names: borrower_id, loan_amount
  • Be specific: primary_borrower_id is better than id
  • Group related variables with prefixes: borrower_name, borrower_email

Variable Organization

  • Keep input variables to the minimum required
  • Use created variables to store intermediate calculations
  • Document complex variable transformations with Comment tasks

Error Prevention

  • Always provide descriptions for input variables
  • Set default values for optional parameters
  • Test variable references with sample data before publishing

Variables are resolved at runtime by the backend. The Workflow Builder validates syntax but cannot verify that a variable path exists until the workflow actually executes with real data.