Step By Step Guide to Calling Flow From an API

Step By Step Guide to Calling Flow From an API

A Flow can be invoked from multiple places. You can invoke it from a button, embed it on your pages, invoke it when DML operations are performed, schedule to run it or even invoke it through REST API call.

In this step-by-step guide, you will learn how to call a Flow from an API, how to pass parameters to the Flow and how Flow will return the values back to the API

Introducing Mastering Salesforce Flows Training Course

Liked this guide? We are now offering a complete self-paced, video-based training course on Mastering Salesforce Flows. The course comes with downloadable step-by-step PDF guides, unlimited access, free upgrades, area to ask questions, free preview & 100% money back guarantee. For more details, please click here.

Need Help with Flows?

Need advice on Flows? I also offer advisory & consulting services on Salesforce Flows. So, whether you want to create new Flows or migrate existing automations (Workflow Rules, Process Builder, Triggers) to Flows, I can help you analyze, design, plan & review. To initiate a discussion, please submit the contact form here stating your requirement or book a 30-minute free discovery callĀ at this URL.

References & Useful URLs

4 thoughts on “Step By Step Guide to Calling Flow From an API”

  1. Hello and thank you for the cool tutorial!

    I would like to handover a record of the standard Contact object (defined as an sObject “sO_Contact” variable in the flow) via JSON. How to put it in the right format for the API to accept it?

    This won’t work:
    [{

    “inputs”: {
    “sO_Contact”: {
    “FirstName”: “Julian”,
    “LastName”: “APIviaSObject3”,
    “Email”: “julian@customer.de”,
    “AccountId”: “0010Q00001ZajJwQAJ”
    }
    }
    }]

    “message”: “Can not deserialize: unexpected array at [line:1, column:1]”,

    1. Hi Julian, It should be formatted like this. I have tested this out and it works.

      {
      "inputs" : [{
      "accountRecord" : {
      "Name" : "Account from API",
      "BillingCountry" : "Singapore"
      }
      }]
      }

  2. Hello Ashish, thank you for this guide.

    I’m able to test a custom, auto launched flow from Workbench like on this guide.

    However, trying to call the endpoint from a Python script gets me a JSON object describing the Flow: “{“allowsTransactionControl”:false,”category”:null,”configurationEditor”:null,”description”….}

    Have you encountered a similar issue, or are Flow APIs only callable from inside Workbench?

    1. Hi Sergio,

      The Flow APIs can be called from anywhere. It is not restricted to Workbench. I am not familiar with Python, but can you try if you are able to make other API calls to the same Salesforce org with the same user credentials and and getting a proper response. If you can run it from Workbench, it should work fine from other places also.

      Regards,
      Ashish

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top

Don't Miss Out on New Step-by-Step How To Guides on Salesforce...

…Subscribe to Our Newsletter!