Reusable Content
Keeping yourself DRY makes things more simple.
Subprocesses


Environment Variables


Was this helpful?
Keeping yourself DRY makes things more simple.
In order to keep up with DRY principle (Don't Repeat Yourself), Frends includes Subprocesses and Environment Variables to allow defining functionality and values once and reusing them in your Processes.
Subprocesses in Frends are like building blocks that help simplify complex integrations, much like functions or methods in other programming languages. They're reusable bits of Tasks and logic that you can run across different Processes.

Essentially the only differences between "Main Processes" and Subprocesses are that you can only define a single Manual Trigger, which is used to provide parameters to the Subprocess to work on, and that Subprocesses can be called from Processes and other Subprocesses, while Processes cannot. Subprocesses can also be called on unhandled errors from Processes, making them the catch-block error handlers.

Whenever you have a set of Tasks fulfilling an operation you need in multiple Processes, it becomes useful to separate that into a Subprocess instead. For example running AI Connector as a predefined AI agent with specific parameters, mapping and delivering customer data or performing authentication token query with a cache are all excellent uses of Subprocess.
In case it is global values you need in multiple Processes, or values that are Environment specific, such as different credentials and connection points for testing and production environments, Environment Variables are there to take care of them.

Environment Variables are defined centrally in the Environment Variables section of Frends Control Panel, and can hold groups of values for different purposes. Values can be grouped together by their purpose, such as per target system or for specifically global error handling, and the values themselves can be textual, numerical, lists or secrets.
As the key feature of Environment Variables, each Environment in your Frends Tenant can receive separate values for the same variable. This makes it easy to develop and test the integrations using test values and test environments as target systems, and when the Process is ready, it can be deployed to production without any changes to the Process itself, because the Environment-specific values are defined separately and centrally in Environment Variables.

Was this helpful?
Was this helpful?

