AltScore
Workflow Builder/Task Reference

Task Types Reference

Workflow Builder V2 provides a comprehensive set of task types organized into four categories: Control Flow, Actions, Operations, and Utilities. Each task type defines specific behavior, configuration options, and visual representation on the canvas.

Control Flow Tasks

Control flow tasks manage the execution path of your workflow, enabling conditional branching, waiting, variable operations, and defining entry/exit points.

start

The entry point for every workflow. Each workflow must have exactly one start task.

Input Schema

FieldTypeRequiredDescription
---No input required

Output Schema

FieldTypeDescription
workflow_inputobjectThe input data passed when executing the workflow

Configuration Options

The start task requires no configuration. It automatically receives the workflow input data when execution begins.

Example Use Case

Every workflow begins with a start task. When you execute a workflow with input data like {"borrower_id": "12345"}, this data becomes available as workflow_input for subsequent tasks.


end

The exit point for a workflow. Defines what data the workflow returns upon completion.

Input Schema

FieldTypeRequiredDescription
outputanyNoThe data to return as workflow output

Output Schema

FieldTypeDescription
resultanyThe final workflow output

Configuration Options

OptionTypeDescription
outputMappingobjectMaps values from previous tasks to the final output
statusCodenumberHTTP status code to return (default: 200)

Example Use Case

At the end of a credit evaluation workflow, use the end task to return a structured response containing the decision, score, and any relevant metadata.


conditional

Branch workflow execution based on conditions. Supports multiple branches with if/elif/else logic.

Input Schema

FieldTypeRequiredDescription
expression_contextobjectNoVariables available for condition evaluation

Output Schema

FieldTypeDescription
matched_branchstringID of the branch that was taken

Configuration Options

OptionTypeDescription
branchesarrayList of branch definitions
branches[].idstringUnique identifier for the branch
branches[].labelstringDisplay name for the branch
branches[].expressionstringPython expression that evaluates to boolean
branches[].isElsebooleanWhether this is the default/else branch

Branch expressions use Python syntax. Access variables using the input mapping system, e.g., score > 700 where score is mapped from a previous task's output.

Example Use Case

After calculating a credit score, use conditional branching to route high-score applicants to automatic approval, medium scores to manual review, and low scores to rejection.


wait

Pause workflow execution for a specified duration.

Input Schema

FieldTypeRequiredDescription
---No input required

Output Schema

FieldTypeDescription
waited_secondsnumberActual time waited in seconds

Configuration Options

OptionTypeDescription
durationnumberTime to wait in seconds
durationUnitstringUnit of time: "seconds", "minutes", "hours"

Example Use Case

When integrating with rate-limited external APIs, use wait tasks to space out requests and avoid hitting rate limits.


set_variable

Create or update workflow variables during execution.

Input Schema

FieldTypeRequiredDescription
variablesarrayYesArray of variable definitions to set

Output Schema

FieldTypeDescription
updated_variablesobjectMap of variable names to their new values

Configuration Options

OptionTypeDescription
variablesarrayList of variables to create/update
variables[].namestringVariable name (alphanumeric and underscores)
variables[].typestringType: "string", "number", "boolean", "object", "array"
variables[].valueanyThe value to assign

Example Use Case

Set a risk_tier variable based on calculated scores that can be referenced by subsequent conditional tasks and output mappings.


compute_variables

Compute multiple variables using expressions in a single task.

Input Schema

FieldTypeRequiredDescription
input_valuesobjectNoValues available for computation

Output Schema

FieldTypeDescription
computedobjectMap of computed variable names to values

Configuration Options

OptionTypeDescription
computationsarrayList of computation definitions
computations[].namestringName of the variable to create
computations[].expressionstringPython expression to evaluate
computations[].typestringExpected output type

Example Use Case

Calculate derived metrics like debt-to-income ratio, monthly payment amounts, or risk scores from raw input data.


variable_operation

This task type is deprecated. Use set_variable instead for new workflows.

Legacy task for operating on variables. Maintained for backward compatibility.


exception

Throw an error to stop workflow execution with a specific error message.

Input Schema

FieldTypeRequiredDescription
conditionbooleanNoIf provided, only throws when true

Output Schema

This task does not produce output - it terminates the workflow.

Configuration Options

OptionTypeDescription
messagestringError message to display
errorCodestringError code for programmatic handling
conditionstringOptional expression - only throws if evaluates to true

Example Use Case

When required data is missing or validation fails, use exception to terminate the workflow early with a clear error message explaining the failure.


Action Tasks

Action tasks perform operations that interact with external systems or execute custom logic.

python

Execute custom Python code within the workflow.

Input Schema

FieldTypeRequiredDescription
inputobjectNoData passed to the execute function
contextobjectNoWorkflow context and variables

Output Schema

FieldTypeDescription
resultanyReturn value from the execute function

Configuration Options

OptionTypeDescription
codestringPython code to execute
timeoutSecondsnumberMaximum execution time (default: 300)

Your Python code must define an execute(input, context) function that returns a value or dictionary. The function receives mapped inputs and workflow context.

Code Structure

def execute(input, context):
    # Access input data
    borrower_id = input.get('borrower_id')
 
    # Perform calculations or logic
    result = process_data(borrower_id)
 
    # Return output (dict or value)
    return {"processed": True, "data": result}

Example Use Case

Implement custom scoring logic, data transformations, or complex calculations that cannot be achieved with other task types.


http

Make HTTP requests to external APIs.

Input Schema

FieldTypeRequiredDescription
url_paramsobjectNoDynamic URL parameters
body_dataobjectNoRequest body data
header_valuesobjectNoDynamic header values

Output Schema

FieldTypeDescription
status_codenumberHTTP response status code
headersobjectResponse headers
bodyanyResponse body (parsed JSON or text)

Configuration Options

OptionTypeDescription
urlstringTarget URL (supports template variables)
methodstringHTTP method: GET, POST, PUT, PATCH, DELETE
headersobjectRequest headers as JSON
bodystringRequest body (JSON string for POST/PUT/PATCH)
timeoutSecondsnumberRequest timeout in seconds
authTypestringAuthentication type: "none", "bearer", "basic", "oauth2"
authConfigobjectAuthentication configuration

Example Use Case

Query external credit bureaus, verify identity through third-party services, or send notifications via webhooks.


soap

Make SOAP web service calls.

Input Schema

FieldTypeRequiredDescription
parametersobjectNoSOAP operation parameters

Output Schema

FieldTypeDescription
responseobjectParsed SOAP response
raw_xmlstringRaw XML response

Configuration Options

OptionTypeDescription
wsdlUrlstringWSDL endpoint URL
operationstringSOAP operation to call
parametersobjectOperation parameters
headersobjectSOAP headers

Example Use Case

Integrate with legacy banking systems or government services that expose SOAP-based APIs.


altdata_enrichment

Query AltScore data sources for enrichment data.

Input Schema

FieldTypeRequiredDescription
identifierstringYesPrimary identifier (e.g., national ID)
identifier_typestringYesType of identifier

Output Schema

FieldTypeDescription
dataobjectEnrichment data from the data source
source_idstringData source identifier
retrieved_atstringTimestamp of data retrieval

Configuration Options

OptionTypeDescription
dataSourcestringAltData source identifier
versionstringData source version
inputMappingobjectMap workflow data to source inputs

Example Use Case

Enrich borrower profiles with alternative data such as utility payment history, mobile phone behavior, or social media signals.


Operation Tasks

Operation tasks perform business logic operations within the AltScore platform.

create_borrower

Create a new borrower entity in the system.

Input Schema

FieldTypeRequiredDescription
borrower_dataobjectYesBorrower information

Output Schema

FieldTypeDescription
borrower_idstringID of the created borrower
created_atstringCreation timestamp

Configuration Options

OptionTypeDescription
borrowerTypestringType of borrower: "individual", "business"
fieldMappingsobjectMap input data to borrower fields
categorystringBorrower category

Example Use Case

As part of an onboarding workflow, create borrower records from application data submitted through your portal.


update_borrower

Update an existing borrower's information.

Input Schema

FieldTypeRequiredDescription
borrower_idstringYesID of borrower to update
updatesobjectYesFields to update

Output Schema

FieldTypeDescription
borrower_idstringID of the updated borrower
updated_fieldsarrayList of fields that were updated

Configuration Options

OptionTypeDescription
fieldMappingsobjectMap input data to borrower fields
merge_strategystringHow to handle nested objects: "replace", "merge"

Example Use Case

Update borrower contact information, employment details, or financial data as new information becomes available.


execute_evaluator

Run an evaluator (scorer) against borrower data.

Input Schema

FieldTypeRequiredDescription
borrower_idstringYesID of the borrower to evaluate
additional_dataobjectNoExtra data for evaluation

Output Schema

FieldTypeDescription
scorenumberCalculated score
decisionstringEvaluation decision
metricsobjectIndividual metric values
rules_triggeredarrayList of rules that were triggered

Configuration Options

OptionTypeDescription
executorIdstringID of the evaluator to run
alertActivebooleanWhether to generate alerts from evaluation

Evaluators combine scorecards, metrics, and rules to produce credit decisions. The input schema is automatically populated based on the selected evaluator's requirements.

Example Use Case

Execute a credit scoring model that evaluates borrower risk based on financial history, behavior patterns, and alternative data.


create_alert

Generate an alert based on workflow conditions.

Input Schema

FieldTypeRequiredDescription
borrower_idstringYesAssociated borrower ID
alert_dataobjectNoAdditional alert context

Output Schema

FieldTypeDescription
alert_idstringID of the created alert
severitystringAlert severity level

Configuration Options

OptionTypeDescription
alertTypestringType of alert to create
severitystringSeverity: "low", "medium", "high", "critical"
messagestringAlert message (supports templates)
metadataobjectAdditional alert metadata

Example Use Case

When fraud indicators are detected during evaluation, create a high-severity alert for the compliance team to review.


evaluate_rules

Evaluate a set of business rules.

Input Schema

FieldTypeRequiredDescription
rule_inputobjectYesData to evaluate against rules

Output Schema

FieldTypeDescription
passedbooleanWhether all required rules passed
resultsarrayIndividual rule results
failed_rulesarrayList of rules that failed

Configuration Options

OptionTypeDescription
ruleSetstringID of the rule set to evaluate
stopOnFirstFailurebooleanStop evaluation on first rule failure

Example Use Case

Validate that a loan application meets all policy requirements such as minimum income, maximum debt ratio, and age restrictions.


create_identity

Create an identity record for a borrower.

Input Schema

FieldTypeRequiredDescription
borrower_idstringYesAssociated borrower ID
identity_dataobjectYesIdentity information

Output Schema

FieldTypeDescription
identity_idstringID of the created identity
verification_statusstringInitial verification status

Configuration Options

OptionTypeDescription
identityTypestringType: "national_id", "passport", "drivers_license"
fieldMappingsobjectMap input data to identity fields

Example Use Case

Store verified identity documents during the KYC process, linking them to the borrower profile.


fetch_entity

Fetch a single entity from a borrower's collection.

Input Schema

FieldTypeRequiredDescription
borrower_idstringYesBorrower ID
entity_typestringYesType of entity to fetch
entity_idstringNoSpecific entity ID (optional)

Output Schema

FieldTypeDescription
entityobjectThe fetched entity data
foundbooleanWhether the entity was found

Configuration Options

OptionTypeDescription
collectionTypestringType of collection to query
filtersobjectFilter criteria for entity selection
sortBystringField to sort by when selecting

Example Use Case

Retrieve the borrower's most recent bank statement or employment verification record.


fetch_entities

Fetch multiple entities from a borrower's collections.

Input Schema

FieldTypeRequiredDescription
borrower_idstringYesBorrower ID
entity_typestringYesType of entities to fetch

Output Schema

FieldTypeDescription
entitiesarrayArray of fetched entities
countnumberNumber of entities returned
totalnumberTotal matching entities

Configuration Options

OptionTypeDescription
collectionTypestringType of collection to query
filtersobjectFilter criteria
limitnumberMaximum entities to return
offsetnumberPagination offset

Example Use Case

Retrieve all active loans for a borrower to calculate total existing debt.


workflow_selector

Call another workflow as a sub-workflow.

Input Schema

FieldTypeRequiredDescription
workflow_inputobjectNoInput to pass to the sub-workflow

Output Schema

FieldTypeDescription
outputanyOutput from the sub-workflow
execution_idstringID of the sub-workflow execution

Configuration Options

OptionTypeDescription
workflowIdstringID of workflow to execute
workflowAliasstringAlias of workflow (alternative to ID)
waitForCompletionbooleanWhether to wait for sub-workflow to complete
inputMappingobjectMap current context to sub-workflow input

Example Use Case

Decompose complex processes into reusable sub-workflows. Call a verification workflow from both new application and renewal workflows.


mapping_table

Look up a value in a mapping table.

Input Schema

FieldTypeRequiredDescription
lookup_keystringYesKey to look up in the table

Output Schema

FieldTypeDescription
valueanyThe mapped value
foundbooleanWhether a mapping was found
default_usedbooleanWhether the default value was used

Configuration Options

OptionTypeDescription
tableIdstringID of the mapping table
keyFieldstringField to use as lookup key
defaultValueanyValue to return if no match found

Example Use Case

Map country codes to risk tiers, or convert categorical values like employment types to numerical weights.


scorecard

Execute a scorecard evaluation.

Input Schema

FieldTypeRequiredDescription
scorecard_inputobjectYesData for scorecard evaluation

Output Schema

FieldTypeDescription
total_scorenumberAggregated scorecard score
category_scoresobjectScores by category
factor_detailsarrayIndividual factor contributions

Configuration Options

OptionTypeDescription
scorecardIdstringID of the scorecard to execute
inputMappingobjectMap workflow data to scorecard inputs

Example Use Case

Calculate a credit score using a points-based scorecard model that assigns weights to factors like payment history, credit utilization, and account age.


Business Logic Tasks

Business logic tasks implement decision-making structures for credit evaluation.

decision_tree

Execute decision tree logic for rule-based decisions.

Input Schema

FieldTypeRequiredDescription
decision_inputobjectYesData for decision tree evaluation

Output Schema

FieldTypeDescription
decisionstringFinal decision from the tree
patharrayNodes traversed to reach decision
confidencenumberConfidence score (if applicable)

Configuration Options

OptionTypeDescription
treeIdstringID of the decision tree
inputMappingobjectMap workflow data to tree inputs

Example Use Case

Implement automated credit decisions based on a decision tree that evaluates income levels, employment status, and credit history.


rule_tree

Execute rule tree logic for complex conditional evaluation.

Input Schema

FieldTypeRequiredDescription
rule_inputobjectYesData for rule tree evaluation

Output Schema

FieldTypeDescription
resultanyResult from rule tree evaluation
rules_evaluatedarrayList of rules that were evaluated
final_rulestringThe terminal rule that produced the result

Configuration Options

OptionTypeDescription
ruleTreeIdstringID of the rule tree
inputMappingobjectMap workflow data to rule tree inputs

Example Use Case

Apply complex policy logic with nested conditions to determine loan terms, interest rates, or required documentation.


Utility Tasks

Utility tasks provide helper functionality for workflow development.

comment

Add a documentation note to the workflow. This task does not execute any logic.

Input Schema

No input - this task is non-executing.

Output Schema

No output - this task is non-executing.

Configuration Options

OptionTypeDescription
textstringComment text
colorstringVisual color for the comment block

Comment tasks are purely for documentation purposes. They appear on the canvas to help explain workflow logic but are skipped during execution.

Example Use Case

Add explanatory notes near complex conditional logic or integration points to help other team members understand the workflow design.


Best Practices

Task Selection

  1. Use the simplest task that meets your needs - If a mapping table can solve your problem, prefer it over Python code
  2. Leverage built-in operations - Tasks like execute_evaluator and scorecard are optimized for credit decisioning
  3. Consider sub-workflows - Use workflow_selector to create reusable components

Error Handling

  1. Validate inputs early - Use conditional tasks to check for required data before making external calls
  2. Handle external failures - HTTP and SOAP tasks can fail; plan for retries and fallback logic
  3. Use exception tasks deliberately - Terminate workflows with clear error messages when unrecoverable conditions occur

Performance

  1. Minimize external calls - Batch data retrieval where possible
  2. Set appropriate timeouts - Configure timeouts based on expected response times
  3. Use async execution - For long-running workflows, execute asynchronously and poll for results