Repeating an integration with Dynamic Connections
Flowgear allows you to inject a Connection ID directly into the Connection Property of a Connector Node. This technique allows you to build a single Workflow that cycles through a set of Connections.
There are two approaches you can use:
- If you want to be able to independently start/stop and schedule the integration, you can use the
Scheduler/Worker
pattern. - If you have a large number of integrations, you can store the connection details in a Configuration and use an the
Iterator/Worker
pattern
In both of the above patterns, you'll begin by creating a sub-Workflow like this one. Note the Variable Bar
which includes Properties that are connected to the Connection Properties of the Salesforce
and SAP S/4HANA
Nodes.
The sfConnection
and sapConnection
Properties are set as Connection
Properties rather than Text
so when this Workflow is used as a sub-Workflow, you'll be able to select the Connection you want.
Scheduler/Worker pattern
Create a separate top-level Workflow for each unique Connection combination you want to support, call into the sub-Workflow with the specific Connections you want for that combination.
Iterator/Worker pattern
Add a Variable Bar
to your iterator (top-level) Workflow and add a Property called sfToSapConfig
to it. Change Default Property
to Configuration Property
and provide a name in Configuration Name
.
This is called a Configuration Property and it allows you to store configuration data outside of the Workflow design. Read more about Configuration Properties.
Save your Workflow and click <
to go back to the Landing Pane, then click Configure
. Set the sfToSapConfig
Property to a document like the one below which lists all Connection combinations that will be processed by the Workflow.
[
{
"name": "first customer",
"sfConnection": "7024b42f-c13f-43c3-9f04-4535f90e6d2c",
"sapConnection": "82b15a29-ee1f-413a-8705-cf7b85db779d"
},
{
"name":"second customer",
"sfConnection": "06d1bf0b-7541-49a2-bf18-24b9125ea1a1",
"sapConnection": "71f7f85a-ffae-4bb4-b278-53daaf60dc7d"
}
]
In the document above, sfConnection
and sapConnection
are the Connection ID's for each of the Connections you have set up. You can see the Connection ID from within a Connection by clicking Show Advanced
.
Click Save, then return to the Workflow Design.
Add a For Each
Node and connect a Data Flow Connector from the Variable Bar sfToSapConfig
Property to the SourceDocument
Property of For Each
.
Run the Workflow so that sample data is available to the For Each
Node.
Finally, add the Worker sub-Workflow and connect Data Flow Connectors from the Item
Property of For Each
into the two Connection Properties of the sub-Workflow Node.
Use a Data Flow Connector Expression to pull the appropriate Connection field from Item
in to the sfConnection
and sapConnection
Properties of the sub-Workflow.