When building care flows, there will be situations where you need to reuse data youโve already used elsewhere. This is especially common when setting up integrations, where you might frequently repeat values such as an API URL or API key.
Using constants, you can define these static values once and reuse them in multiple places throughout your care flow, ensuring consistency and reducing repetition.
Within Awell, there are two types of constants:
Global constants:
These are defined at the organizational level and are accessible across all care flows.Care flow constants:
These are defined at the individual care flow level and are only accessible within the scope of the current care flow.
Creating constants
Global constants
Global constants are managed in the CareOps application under settings. Note that this section is only accessible to Organisation admins.
Global constants must be managed manually across environments as they are not synchronized between Sandbox and Production. Instead, you need to configure constants separately for each environment. The names of global constants must be identical in all your environments.
Important notes:
When you update the value of a global constant, the change will only take effect after the care flow that uses the constant is re-published.
Updating a global constant does not impact care flows that were already published or any ongoing care flows. Only newly published care flows and instances created after the update will use the updated value.
Care flow constants
Go to the Elements tab of your care flow
Select Constants in the right-hand menu
Click the "Create constant" button
Enter a name for the constant
Enter a value for the constant
Define if you want to conceal your value. Note: this action is irreversible. Once a value is concealed it will not be shown through the UI and will stay encrypted. When used in API calls, the receiving end will of course receive the decrypted value.
Click "Save" to start using your constant in your care flow.
Use a constant
Both global and care flow constants can be used in the same way:
Open an action or location where you'd like to insert the constant (e.g. an API call)
Type
/
to open the data variables menuSearch and select one of the available constants in the drop-down.