Salesforce Flow REST API

REST API for managing and executing Salesforce Flows programmatically. Enables creating, updating, querying, and executing flow automation processes, flow interviews, and invocable actions within Salesforce.

OpenAPI Specification

salesforce-flow-rest-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Salesforce Flow REST API
  description: >-
    REST API for managing and executing Salesforce Flows programmatically.
    Enables creating, updating, querying, and executing flow automation
    processes, flow interviews, and invocable actions within Salesforce.
  version: 59.0.0
  termsOfService: https://www.salesforce.com/company/legal/agreements/
  contact:
    name: Salesforce Developer Support
    url: https://developer.salesforce.com/
  license:
    name: Salesforce Master Subscription Agreement
    url: https://www.salesforce.com/company/legal/agreements/
externalDocs:
  description: Salesforce Flow REST API Developer Guide
  url: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_flow.htm
servers:
  - url: https://{instance}.salesforce.com/services/data/v59.0
    description: Salesforce Production or Developer Edition
    variables:
      instance:
        default: yourInstance
        description: Your Salesforce instance identifier
security:
  - oauth2: []
  - bearerAuth: []
tags:
  - name: Flow Definitions
    description: Operations for managing Flow metadata and definitions
  - name: Flow Interviews
    description: Operations for executing and managing Flow interviews
  - name: Invocable Actions
    description: Operations for triggering invocable flows as actions
  - name: Flow Categories
    description: Operations for organizing flows by category
paths:
  /sobjects/Flow:
    get:
      operationId: listFlows
      summary: List Flow Definitions
      description: >-
        Retrieves a list of Flow definitions available in the Salesforce org,
        including metadata such as API name, label, type, and status.
      tags:
        - Flow Definitions
      parameters:
        - name: q
          in: query
          description: SOQL query string to filter flows
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved list of flows
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowListResponse'
        '401':
          description: Unauthorized - invalid or expired session
  /sobjects/Flow/{flowId}:
    get:
      operationId: getFlow
      summary: Get Flow Definition
      description: >-
        Retrieves details about a specific Flow definition including its
        metadata, version, and associated interview settings.
      tags:
        - Flow Definitions
      parameters:
        - name: flowId
          in: path
          required: true
          description: The unique Salesforce ID of the Flow record
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved flow definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowDefinition'
        '404':
          description: Flow not found
    patch:
      operationId: updateFlow
      summary: Update Flow Definition
      description: >-
        Updates metadata fields on an existing Flow definition, such as
        its active status or description.
      tags:
        - Flow Definitions
      parameters:
        - name: flowId
          in: path
          required: true
          description: The unique Salesforce ID of the Flow record
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FlowUpdateInput'
      responses:
        '204':
          description: Flow updated successfully
        '400':
          description: Invalid request payload
  /sobjects/FlowInterview:
    post:
      operationId: createFlowInterview
      summary: Create Flow Interview
      description: >-
        Creates and starts a new Flow Interview (a running instance of a Flow).
        Optionally passes input variables to initialize the Flow.
      tags:
        - Flow Interviews
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FlowInterviewInput'
      responses:
        '201':
          description: Flow Interview created and started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResponse'
        '400':
          description: Invalid request or Flow not found
  /sobjects/FlowInterview/{interviewId}:
    get:
      operationId: getFlowInterview
      summary: Get Flow Interview
      description: >-
        Retrieves the current state, status, and output variables of a
        running or completed Flow Interview.
      tags:
        - Flow Interviews
      parameters:
        - name: interviewId
          in: path
          required: true
          description: The unique Salesforce ID of the FlowInterview record
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved flow interview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowInterview'
        '404':
          description: Interview not found
    delete:
      operationId: deleteFlowInterview
      summary: Delete Flow Interview
      description: >-
        Deletes a Flow Interview record. Typically used for paused interviews
        that are no longer needed.
      tags:
        - Flow Interviews
      parameters:
        - name: interviewId
          in: path
          required: true
          description: The unique Salesforce ID of the FlowInterview record
          schema:
            type: string
      responses:
        '204':
          description: Interview deleted successfully
        '404':
          description: Interview not found
  /actions/custom/flow:
    get:
      operationId: listInvocableFlows
      summary: List Invocable Flows
      description: >-
        Returns a list of all flows that are exposed as invocable actions,
        including their API names and input/output variable definitions.
      tags:
        - Invocable Actions
      responses:
        '200':
          description: Successfully retrieved invocable flows
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvocableActionList'
  /actions/custom/flow/{flowApiName}:
    get:
      operationId: getInvocableFlowMetadata
      summary: Get Invocable Flow Metadata
      description: >-
        Retrieves the input and output variable definitions for a specific
        invocable flow action.
      tags:
        - Invocable Actions
      parameters:
        - name: flowApiName
          in: path
          required: true
          description: The API name of the Flow
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved flow action metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvocableFlowMetadata'
    post:
      operationId: invokeFlow
      summary: Invoke Flow Action
      description: >-
        Executes a Flow as an invocable action, passing input variables and
        receiving output variables upon completion.
      tags:
        - Invocable Actions
      parameters:
        - name: flowApiName
          in: path
          required: true
          description: The API name of the Flow to invoke
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvokeFlowInput'
      responses:
        '200':
          description: Flow executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvokeFlowResponse'
        '400':
          description: Invalid input variables or flow error
  /query:
    get:
      operationId: queryFlows
      summary: Query Flows with SOQL
      description: >-
        Executes a SOQL query to retrieve Flow and FlowInterview records
        with custom filtering, ordering, and field selection.
      tags:
        - Flow Definitions
      parameters:
        - name: q
          in: query
          required: true
          description: SOQL query string (e.g. SELECT Id, ApiName, Status FROM Flow)
          schema:
            type: string
      responses:
        '200':
          description: Query results returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResult'
        '400':
          description: Invalid SOQL query
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://login.salesforce.com/services/oauth2/authorize
          tokenUrl: https://login.salesforce.com/services/oauth2/token
          scopes:
            api: Access and manage your data
            full: Full access
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    FlowListResponse:
      type: object
      properties:
        totalSize:
          type: integer
          description: Total number of flows returned
        done:
          type: boolean
        records:
          type: array
          items:
            $ref: '#/components/schemas/FlowSummary'
    FlowSummary:
      type: object
      properties:
        Id:
          type: string
          description: Salesforce record ID
        ApiName:
          type: string
          description: API name of the Flow
        Label:
          type: string
          description: Display label of the Flow
        ProcessType:
          type: string
          description: Type of flow (Flow, AutoLaunchedFlow, etc.)
        Status:
          type: string
          enum:
            - Active
            - Obsolete
            - Draft
            - InvalidDraft
          description: Current activation status
        VersionNumber:
          type: integer
          description: Version number of the flow
    FlowDefinition:
      type: object
      properties:
        Id:
          type: string
        ApiName:
          type: string
        Label:
          type: string
        Description:
          type: string
        ProcessType:
          type: string
        Status:
          type: string
        VersionNumber:
          type: integer
        CreatedDate:
          type: string
          format: date-time
        LastModifiedDate:
          type: string
          format: date-time
        CreatedById:
          type: string
        LastModifiedById:
          type: string
    FlowUpdateInput:
      type: object
      properties:
        Description:
          type: string
          description: Updated description for the flow
        Status:
          type: string
          enum:
            - Active
            - Obsolete
          description: New status for the flow
    FlowInterviewInput:
      type: object
      required:
        - FlowDefinitionView
      properties:
        FlowDefinitionView:
          type: object
          properties:
            ApiName:
              type: string
              description: API name of the flow to start
        inputs:
          type: array
          description: Input variable values for the flow
          items:
            $ref: '#/components/schemas/FlowInputVariable'
    FlowInputVariable:
      type: object
      properties:
        name:
          type: string
          description: Variable name
        value:
          description: Variable value (any type)
    FlowInterview:
      type: object
      properties:
        Id:
          type: string
        CurrentElement:
          type: string
          description: Name of the current flow element
        GuidedFlowName:
          type: string
        HasFinished:
          type: boolean
        Name:
          type: string
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/FlowOutputVariable'
    FlowOutputVariable:
      type: object
      properties:
        name:
          type: string
        value:
          description: Output variable value
    InvocableActionList:
      type: object
      properties:
        actions:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              label:
                type: string
              type:
                type: string
    InvocableFlowMetadata:
      type: object
      properties:
        name:
          type: string
        label:
          type: string
        type:
          type: string
        inputs:
          type: array
          items:
            $ref: '#/components/schemas/ActionParameter'
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/ActionParameter'
    ActionParameter:
      type: object
      properties:
        name:
          type: string
        label:
          type: string
        description:
          type: string
        required:
          type: boolean
        type:
          type: string
        maxOccurs:
          type: integer
    InvokeFlowInput:
      type: object
      properties:
        inputs:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Array of input variable objects for the flow
    InvokeFlowResponse:
      type: object
      properties:
        outputs:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Array of output variable objects from the flow
    CreateResponse:
      type: object
      properties:
        id:
          type: string
          description: Salesforce record ID of the created resource
        success:
          type: boolean
        errors:
          type: array
          items:
            type: string
    QueryResult:
      type: object
      properties:
        totalSize:
          type: integer
        done:
          type: boolean
        nextRecordsUrl:
          type: string
        records:
          type: array
          items:
            type: object
            additionalProperties: true