An input attribute is a field from the payload that is supplied to Alloy, which is selected to be used within the Workflow's decisioning logic. It is information about an applicant supplied to Alloy, and may either be a standard payload field, or custom field. Standard payload fields are those that are sent to 3rd party vendors; custom fields are data that are submitted to Alloy as supplemental information, but would not be passed on to third-party services unless the third-party services accepts the custom field. Custom fields are typically nested within a meta
object.
The uses for Input Attributes are very wide. For example, you may want to have a Router workflow that sends the Application one way if email_address
is provided and another way if it is not. Or you may want to set a tag called "Minor" if age
is younger than 18.
This means that you'll first need to create an Input Attributes for the email_address
or age
field you're sending as part of your payload to Alloy.
This article will cover the following sections:
- Identifying an Input Attribute node in a Workflow
- Adding a new Input Attribute
- Setting the Attribute Name when using jq
- Editing Input Attributes
- Common Input Attribute Recipes
Identifying an Input Attribute node in a Workflow
Input Attributes in a workflow are denoted by a blue node with an icon of arrow pointing to the right, entering into a bracket.
Adding a new Input Attribute
To start adding an Input Attribute:
- Click the Add menu at the top right hand side of the Workflow builder.
- Select Input Attribute from the menu.
- Within the Add Input Attribute modal, fill out the fields.
- You can select New Attribute or Published Attribute. At this point, keep New Attribute selected to add an Input Attribute. Input Attributes are used in the context of the Workflow you are configuring it to. Published Input Attributes are stored on the Entity profile to be used in future scenarios without re-supplying the same input data. Click to learn more about working with Published Attributes.
- Attribute Name: Add the JSON path to the attribute you'd like to use. This requires knowing the exact naming convention and JSON path to this attribute in the supplied data sent to Alloy. Only unique attribute names are allowed. If an input attribute with a matching name already exists in the workflow version, a duplicate input attribute will not be saved. See the section Setting the Attribute Name when using jq on how to set the Attribute Name when using or not using jq.
- Data Type: Select one of the data types from the drop-down.. The data type selected should match the data type being sent to Alloy for this attribute.
- Publish this attribute: Check this box if you'd like this input attribute on the entity profile to be stored for decisioning in future Workflows. Additional options become available when enabling this setting. Click to learn more about Published Input Attribute settings.
- Parse incoming values with JQ?: jq is command-line tool is a lightweight and flexible command-line JSON processor. Alloy supports using jq to change JSON data for complex payload structures within the Workflow. Once the checkbox is selected, a box will appear for the JQ Formula. The JQ expression should be written here; the data type selected for the Input Attribute should match the output of the JQ expression. Click to learn more about setting the attribute name when using JQ.
- Once the attribute is configured, click Add Attribute.
Once an Input Attribute has been added, it will appear to the left-most column of the Workflow (this means that this node will always run). From here, tags can be added based on Input Attribute values.
Setting the Attribute Name when using jq
When you create an input attribute without jq, the Attribute Name must be the JSON selector of the field you're referencing.
If you are creating an input attribute with jq, the Attribute Name is just a label in the editor (and the dashboard rerun forms) and can be any human-readable name. The field selector is driven by the jq expression.
So to give a simple example, there could be a payload:
{
"email_address": "example@alloy.com"
}
The input attribute without jq, the Attribute Name needs to be email_address
since thats also the JSON selector that leads to the JSON path this field within the raw response.
The input attribute with jq, the Attribute Name could be an arbitrary human-readable name such as "Email Address", but the jq expression would be .email_address
.
For more information on using jq, the following resources are recommended:
- jq manual: A comprehensive guide to learning the basics of jq.
- jq play: An interactive platform for testing jq formulas.
Editing Input Attributes
Once an Input Attribute has been added, it can still be edited. Clicking on the blue Input Attribute node will slide out a drawer. You can edit:
- Display Name: This is the name of the attribute that is displayed, as well as the JSON path for the attribute in the supplied payload to Alloy.
- Data Type: The data type selected should match the data type being sent to Alloy for this attribute.
- Description: This is not available yet but will be in the future.
- Parse incoming values with JQ?: Enable or disable jq for the attribute. Once enabled, you can add a jq formula. Once disabled, the formula is greyed out and does not run.
- Replace with Published Attribute: As you are adding Published Attributes in your system, you may find that you want to replace an existing Input Attribute in a workflow with a Published Attribute instead. Click to learn more about Published Input Attribute settings.
Common Input Attribute Recipes
It is ultimately up to your organization on how to use Input Attributes and what data to supply within the API requests to the Workflow. Any information about the entity that would be relevant data for informational and/or decisional purposes can be supplied to Alloy and used in the Workflow.
Below are a few common examples we have seen, but in no way represent all the possibilities.
Use Case 1: Adding an Input Attribute for age to tag a Minor
Age is a unique formatted attribute that is generated and made available as a formatted attribute by the Alloy system as long as the date of birth is supplied. When following this recipe, note that age
doesn't actually need to be specifically supplied by the applicant; this becomes available out-of-the-box when supplying birth_date
.
-
Supply a
birth_date
field to Alloy as a string-type in the format of YYYY-MM-DD.{ "birth_date" : "1970-01-01" }
-
Alloy will automatically calculate the age and store that in a formatted attribute called
age
. This attribute is automatically created by Alloy and can be used as an input attribute. -
Add a new Input Attribute to the Workflow.
-
In the Add Input Attribute modal, fill out:
-
Attribute Name:
age
- Data Type: Integer
- Publish this attribute: Do not check this box unless you want to publish the attribute and use it in other Workflows
- Parse incoming values with JQ?: Do not check this box
-
Attribute Name:
-
Click Add Attribute.
-
Now to add a new tag. Click on the blue Input Attribute node for age.
-
Click the + icon to the right to add a child action node.
-
The Thresholds drawer will slide out to start building the action that will occur:
- Configure the threshold rule to:
If age < 18
. If a minor is considered a different age for your organization, change the value18
to the number reflective of a minor's age. - Then configure the action to:
Then set tag Minor
. "Minor" is a suggestion for the tag name, but you can change the tag name to better fit your organization. - Your Threshold rule now can be read as "If age is less than 18, then set tag 'Minor'":
- Configure the threshold rule to:
-
Click Save on the bottom-right of the drawer to save and set the tag the Workflow.
-
Your Input Attribute and tag is now all set up in the Workflow.
-
Don't forget to click Save on the top-right of the Workflow to save the changes into a new Workflow version.
Use Case 2: Check on whether the application is a Joint application
-
Supply a meta attribute that indicates joint status (e.g.,
is_joint
) to Alloy as a boolean-type. These attributes are typically nested within ameta
object. This example assumes field is calledis_joint
and the values provided for this attribute are booleantrue
orfalse
. If your attribute has different values, adjust the steps accordingly.{ "meta" : { "is_joint" : true // or false } }
-
Add a new Input Attribute to the Workflow.
-
In the Add Input Attribute modal, fill out:
-
Attribute Name:
meta.is_joint
- Data Type: Boolean
- Publish this attribute: Do not check this box unless you want to publish the attribute and use it in other Workflows
- Parse incoming values with JQ?: Do not check this box
-
Attribute Name:
-
Click Add Attribute.
-
Now to add a new tag. Click on the blue Input Attribute node for meta.is_joint.
-
Click the + icon to the right to add a child action node.
-
The Thresholds drawer will slide out to start building the action that will occur:
- Configure the threshold rule to:
If meta.is_joint is true
- Then configure the action to:
Then set tag Joint Account
. "Joint Account" is a suggestion for the tag name, but you can change the tag name to better fit your organization. - Your Threshold rule now can be read as "If meta.is_joint is true, then set tag 'Joint Account'":
`
- Configure the threshold rule to:
-
Click Save on the bottom-right of the drawer to save and set the tag the Workflow.
-
Your Input Attribute and tag is now all set up in the Workflow.
-
Don't forget to click Save on the top-right of the Workflow to save the changes into a new Workflow version.
Use Case 3: Check on whether the application is the primary or secondary application
-
Supply a meta attribute that indicates joint status (e.g.,
applicant_role
) to Alloy as a string-type. These attributes are typically nested within ameta
object. This example assumes field is calledapplicant_role
and the values provided for this attribute arePrimary
orSecondary
. If your attribute has different values, adjust the steps accordingly.{ "meta" : { "applicant_role" : "Primary" // or "Secondary" } }
-
Add a new Input Attribute to the Workflow.
-
In the Add Input Attribute modal, fill out:
-
Attribute Name:
meta.applicant_role
- Data Type: String
- Publish this attribute: Do not check this box unless you want to publish the attribute and use it in other Workflows
- Parse incoming values with JQ?: Do not check this box
-
Attribute Name:
-
Click Add Attribute.
-
Now to add a new tag. Click on the blue Input Attribute node for meta.applicant_role.
-
Click the + icon to the right to add a child action node.
-
The Thresholds drawer will slide out to start building the action that will occur:
- Configure the threshold rule to:
If meta.applicant_role is Primary
- Then configure the action to:
Then set tag Primary Applicant
. "Primary Applicant" is a suggestion for the tag name, but you can change the tag name to better fit your organization. - Your Threshold rule now can be read as "If meta.applicant_role is 'Primary Applicant', then set tag 'Primary Applicant'":
- Configure the threshold rule to:
-
Click Save on the bottom-right of the drawer to save and set the tag the Workflow.
-
Now to add a second new tag. Click on the blue Input Attribute node for meta.applicant_role.
-
Click the + icon to the right to add a child action node.
-
The Thresholds drawer will slide out to start building the action that will occur:
- Configure the threshold rule to:
If meta.applicant_role is Secondary
- Then configure the action to:
Then set tag Secondary Applicant
. "Secondary Applicant" is a suggestion for the tag name, but you can change the tag name to better fit your organization. - Your Threshold rule now can be read as "If meta.applicant_role is 'Secondary Applicant,' then set tag 'Secondary Applicant'":
- Configure the threshold rule to:
-
Click Save on the bottom-right of the drawer to save and set the tag the Workflow.
-
Your Input Attribute has two tags set up in the Workflow.
-
Don't forget to click Save on the top-right of the Workflow to save the changes into a new Workflow version.
Comments
0 comments
Article is closed for comments.