Shared App Connections
In some circumstances it may be desirable to share a single app connection across multiple user accounts.
This can happen when lots of automations need to access the same app connection, where connecting dozens or hundreds of user accounts all to the same app with the same credentials is not practical or desirable.
The system performs the following logic to lookup a connection when an automation executes:
- If the account running the automation has the connection, use it.
- If the connection has "(shared from system setup)" in its name, it is supposed to be in the system's "setup" account. If so use it, otherwise a connection not found runtime error occurs.
- If the connection has "[shared from parent]" in its name, it is supposed to be in the linked parent account. If so use it, otherwise a connection not found runtime error occurs.
- If the account is a child account, check the linked parent account. If that account has the connection, use it.
- Check the system's "setup" account for the connection. If that account has the connection, use it.
- Otherwise a connection not found runtime error occurs.
The system's connection sharing logic combines two approaches: explicitly shared connections and inherited shared connections.
Dedicated systems have a special "setup" account that can be used to create shared app connections:
In this account, create app connections as usual (see App Connections):
Now other accounts in the system will see these connections listed when actions and triggers are edited:
In a similar manner, linked child accounts can use connections shared by their linked parent account. The only difference is that when building the child automation, shared connections appear with "[shared from parent]" in their names.
Connections in the System Setup account are shared by default. Connections in linked parent accounts must be explicitly shared in order to be made available to linked child accounts. See Sharing connections with linked child accounts
The presence of either "(shared from system setup)" or "[shared from parent]" in the connection name means that it is an explicitly shared connection. If the connection is not found at runtime in either the setup or parent account, a connection not found runtime error occurs.
If the connection name does not have either "(shared from system setup)" or "[shared from parent]" in it, then if the account running the automation does not have the named connection the system will check to see if either the account's linked parent (if it is a child account) has the connection, or if the system's "setup" account has it.
The checks are done in that order (self, linked parent, system setup), which forms an inheritance.
The only requirement for a match is the connection name.
When building general-purpose automation templates (see Automation Templates), it is generally best to rely on inherited shared connections. This allows the templates to be deployed in either standalone accounts or in linked child accounts and still be able to utilize connections that may be shared from either the system's "setup" account or from a linked parent account.
Explicitely shared connections are generally not useful for generalized automation templates. A template built for a child account that is configured to use a "[shared]" connection from its parent account will always fail to run in a standalone account that has no linked parent.
The delineation of explicit vs. inherited connection sharing is provided because there are cases where automations or templates need to be built specifically for child accounts such that they will fail at runtime if the linked parent account doesn't have the shared connection available. Explicitly shared connections ensure the scope of the shared connection.