Locoia
  • Overview
  • Account and User Settings
    • User types
    • Adding Users
    • Teams
    • Access Permissions
    • 2 Factor Authentication 2FA
    • Versioning and Snapshots
    • Activity Log
  • Reset your Password
  • Invoices and Payments
  • Automation
    • Flow Builder
      • Flow Building Best Practices
      • Jinja Template Language
        • Jinja: (Custom) variables, wildcards and functions
        • Magic Code Samples
      • Connectors & APIs
        • Titles and References
        • Referencing data of objects, lists, arrays - how to pass data dynamically
        • Accessing Objects with JSONPath
        • Merging nested JSON objects
        • Parsing JSONs from String
        • Response Headers & Status Codes
        • Custom Data Fields
        • Wildcard API calls and actions
        • Response cleaning
      • Text Strings, Date & Time, Numbers and Currencies
        • Text and Strings
        • Dates & Time
        • Numbers (Thousand Separators, Currencies)
      • Email-formatting
      • Code Fields
      • Running single Flow steps
      • Flow run data retention, logging, and error notifications
      • Advanced View
      • Dynamic Title
      • Custom Error Handling
      • Error Handling Flows
      • Automatic Pagination
    • Flow Debugger
      • Automatic Retrying
      • Run Flows again
      • Troubleshooting Flows
    • Community Library
  • Connectors & Helpers
    • Connectors
      • Monday.com
      • ActiveCampaign
      • Aircall
      • Allthings
      • Amplitude
      • Animus
      • Assetti
      • Awork
      • AWS RDS Database - How to connect
      • bubble.io
      • Casavi
      • Chargebee
      • CleverReach
      • comgy
      • commercetools
      • Everreal
      • Exact Online
      • Facebook Marketing
      • Fahrländer Partner
      • FastBill
      • FILESTAGE.io
      • Freshdesk
      • Freshsales
      • Google Ads
      • Google Ads Lead Form
      • Google Analytics
      • Google Chat
      • Google Drive
      • Google Sheets
      • Gmail
      • HubSpot
      • Heyflow
      • iDWELL
      • ImmobilienScout24
      • Instagram Ads
      • Intercom
      • klaviyo
      • Kiwi Opening Doors
      • Klenty
      • Klipfolio
      • Kolibri CRM
      • konfipay
      • KUGU
      • Shopify
      • S3 AWS
      • SQS AWS
      • Lambda AWS
      • Learnster
      • lexoffice
      • LineMetrics
      • Linkedin
      • Locoia
      • Notion
      • MailGun
      • Makula
      • Microsoft Dynamics 365
      • Microsoft OneDrive
      • MixPanel
      • MongoDB
      • Odoo
      • OnFleet
      • OnOffice
      • Oracle NetSuite
      • Outbrain
      • Quickbooks
      • Trello
      • PandaDoc
      • Personio
      • Pinterest Ads
      • Pipedrive
      • Plentific
      • PriceHubble
      • relay
      • REALCUBE
      • Sage ERP
      • Salesforce
      • SAP
      • Scoro
      • Seafile
      • sevDesk
      • SharePoint
      • SharpSpring
      • Slack
      • Snapchat Marketing
      • Snowflake
      • Teamleader Focus
      • Teamwork.com
      • Tableau
      • TikTok
      • TinQwise
      • The Trade Desk
      • Twitter
      • Typeform
      • WordPress
      • Xero
      • Youtube
      • Zendesk
      • Zoho CRM
      • Zoom
    • Helpers
      • Scheduler
      • Webhook
      • Dict Helper
      • Spreadsheet Helper
      • REST Helper
      • Boolean Helper
      • Multi Case Helper
      • Looper
      • FTP Helper
      • CSV Helper
      • XLSX Helper
      • Mail Sender
      • Flow Trigger
      • File Storage Helper
      • Terminate Helper
      • Delay Helper
      • SQL Connector
      • PDF Helper
      • Zip Helper
      • Data Warehouse Helper
      • XML Helper
      • Form Helper
      • Arrow
      • Error Arrow
    • Authentication Types Available
      • Setting up authentication
      • OAuth1
      • OAuth2
      • Refreshable token
      • AWS Signature
      • Basic Auth and Other Simple Authentication Methods
      • How are API versioning and API updates handeled?
      • Custom OAuth2 clients (apps)
    • Building Connectors
      • Base Connector Setup
        • Connector Auth Validation
        • GraphQL APIs
        • Rendering with User Input
      • Building Connector Actions
        • Actions Examples
      • Search Automation
      • Pagination Automation
      • Uploading Files in Actions
      • Working with SOAP APIs
    • Super Actions
    • Webhook Trigger for Connectors
    • Data Mapping and Env Variables
  • Embed - White Label Portal
    • Embed Overview
      • 1. Embed Flow
        • 1.1 Creating Embed Flows
        • 1.2 Updating Embed Flows
        • 1.3 Embed Error Handling
        • 1.4 Setting up Callbacks for Integration activation/deactivation
        • 1.5 Setting up Remote search
        • 1.6 Setting up End User logs
      • 2. Configure Embed
        • 2.1 Embed Integration via SSO
        • 2.2 Proprietary connector setup
        • 2.3 Sharing level
        • 2.4 Consent screen
        • 2.5 Account Secrets
        • 2.7 Further settings
      • 3. Integrate Embed
        • 3.1 iframe vs native embed
        • 3.2 Customizing CSS
        • 3.3 Events emitted from iframe to parent window
      • 4. Embed for End User
        • 4.1 Embed Remote Search
        • 4.2 Embed End User Logs
      • 5. Test Embed Configuration
        • Testing example
      • 6. Embed Integrations and Connector Auths
    • Embed FAQs
  • Data and Dashboards
    • Dashboards & Insights
      • Introduction to Dashboards
      • Introduction to Insights
      • Introduction to Data Sources
      • Dashboard Filters
      • Insight Marketplace - Using Pre-Built Insights
      • Writing SQL Queries
      • Useful SQL Examples
      • Charts
        • Line Chart
        • Bar and Horizontal Bar Chart
        • Stat Card
        • Pie Chart
        • Gauge Chart
        • Donut Chart
        • Stacked Bar, Horizontal Stacked Bar, and Normalized Horizontal Stacked Bar
        • Multiple Line Chart
        • Pivot Table
        • Map Chart
  • Best Practice Guides
    • Integration Best Practices
    • Integration Check List
    • CSV Files in Excel
    • Multi-Tenant Flows
    • On-Premise Integrations
    • Database Connection Setup
    • Data and General Security
    • Using Tags
    • FAQ
  • API
    • Locoia API Authentication - Personal Access Token
    • Create Connector Authentication
  • Contact us
  • Status of Service
  • Data Privacy
  • Imprint
Powered by GitBook
On this page
  • Background
  • Step 1: Have your clients authenticate (login)
  • Step 2a: Dynamically passing in authentication credentials via Webhook
  • Step 2b: Dynamically passing in authentication credentials on Scheduled Flows via Env Variables

Was this helpful?

  1. Best Practice Guides

Multi-Tenant Flows

White label workflow marketplace - Building flows in a multi-tenant fashion

PreviousCSV Files in ExcelNextOn-Premise Integrations

Last updated 8 months ago

Was this helpful?

This feature is for you, if you are a SaaS company and want to build one flow that can be used by multiple of your clients, with each of them using their own custom authentication credentials. Meaning, the flow does exactly the same thing, for all your clients, but with different authentication credentials.

Multi-Tenant Flows is a sub-feature of the , which is a separate product to be enabled by Locoia support. All flows in the WLEP are also created in a multi-tenant fashion - meaning, an instance of a flow is created per each of your customers with their respective credentials and input variables.

Background

You may use our API to build your own white label integration and automation marketplace. Instead of building one flow for each of your clients, you have the option to build one multi-tenant flow that can be used for all your clients, making maintenance and extending it to new clients super easy.

Step 1: Have your clients authenticate (login)

  • Provide your clients with the possibility to select an automation flow and then based on the Connectors used in that flow the possibility to authenticate (Oauth2, BasicAuth, Username/password) your own software and any third party vender software, just like the would in Locoia directly.

  • You can provide them the same , like in Locoia, but in your custom UI style, accessing our API in the background.

  • Authentication needs to happen for all relevant connectors of a particular flow. As part of that you will create multiple Connector Auths and you need to save the corresponding ids and store them on each of your clients account data.

Step 2a: Dynamically passing in authentication credentials via Webhook

  • are best way to use for real-time integrations (mostly also 2-way integrations).

  • In addition to the payload (request body) of a webhook triggering the flow, add the corresponding Connector Auth ids as query-string parameters like this:

    /?zendesk_auth_id=12345678&google_sheet_auth_id=98765432

    This means, you need to send the payload (request body) of the webhook, like normally, and in addition via query string the Connector Auth ids with a wording of your choosing, e.g. zendesk_auth_id.

  • In the corresponding Flow, you will have a webhook receiving this data, with e.g. the reference `web1`. Additionally, you will have, e.g., a Zendesk connector. On the Zendesk connector itself, do NOT choose a Connector Auth, but rather click the blue Name & ref button in the upper right corner of the side-panel of the Zendesk connector:

  • The successful setup should look like the below

  • Now repeat this for each additional Connector and its Authentication, e.g. as per the example google_sheet_auth_id.

  • Done! Whenever the webhook is now called, the query-string parameters are included (appended) in the payload of the webhook, which allows you to dynamically pass in auth ids of your individual clients. Note: you can also directly pass Connector Auth ids in the payload of the webhook if this is technically easier for you.

Step 2b: Dynamically passing in authentication credentials on Scheduled Flows via Env Variables

  • The creation of Connector Authentication can be done either via the Locoia API, called from your system in the look and feel of your UI or manually in the Locoia app.

{
    "customer_name_or_id_1": {
        "zendesk_auth_id": "12345678",
        "google_sheet_auth_id": "98765432"
        ...
    }
},
    "customer_name_or_id_2": {
        "zendesk_auth_id": "12345678",
        "google_sheet_auth_id": "98765432"
        ...
    }
},
    "customer_name_or_id_3": {
        "zendesk_auth_id": "12345678",
        "google_sheet_auth_id": "98765432"
        ...
    }
}
  • The above example shows the Env Variable setup for three customers with two connectors and ... indicating that there could easily be more Connector Auth ids be added, if the flow requires.

  • If a new customer is added to this, it should simply be added (appended) to this in the root level of the JSON structure.

  • Now it's time to setup the flow:

  1. A scheduler is needed, e.g. to run it daily.

  2. The Looper is chosen with the action Iterate over Loop and references the dic1 (just like that without Jinja curly braces, since it is just a reference). Also, the reference name of the loop has been changed to oneClient.

4. Within the Zendesk or Google Sheets connector, you can follow the steps, described under 2a. and include the dynamic auth id, but this time not referencing the webhook web1, but rather the loop like that: {{ oneClient.zendesk_auth_id }} 5. Do the same thing for Google Sheets in our example and any subsequent connector you may have (...), and you are done!

This is a very efficient way of making flow-runs multi-tenant for all your clients. If you have further questions or remarks, please contact us.

The dynamic auth id always overwrites the set Connector Auth on a step, even if the dynamic auth id is invalid.

Many systems don't provide webhooks or there are other reasons, why a scheduled flow execution is sufficient. In these cases, a flow is built and executed with a regular with an interval of your choosing.

To store all the corresponding Connector Auth ids, an is created with e.g. the reference (name) `FlowNameAuthenticationIds`, which needs to be without spaces, so it can be referenced in the flow. The Connector Auth ids should be included as follows:

Next, the is needed with the action Define variables for later use... which needs to reference exactly the previously created Env Variable Input of Define variables action: {{ FlowNameAuthenticationIds }}

Scheduled Flow
Scheduler Helper
Env Variable
Dict & List Helper
White Label Embed Portal (WLEP)
authentication flow
Webhooks
Name & ref