Flow defines executable automation: its connected elements, resources, input and output variables, record operations, and runtime settings. The same metadata type represents screen flows, background automation, specialized product flows, orchestrations, and Process Builder processes.
A flow interview is one runtime execution, not the metadata definition. Structures such as FlowStart, FlowScreen, and FlowSubflow are contained within a Flow; they are not separate deployable components. FlowDefinition is a separate metadata type that can control active-version selection.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The versionless flow identity. An unversioned retrieval returns the latest flow version, which can differ from the active version. |
apiVersion |
The stored configuration that defines execution behavior. This is separate from the Metadata API version used to transport the flow. |
processType |
The flow family and supported functionality. Examples include Flow, AutoLaunchedFlow, Orchestrator, and EvaluationFlow. |
status |
Activation state: Active, Draft, Obsolete, InvalidDraft, or UnderReview. A missing value is treated as Draft. |
runInMode |
Execution context. DefaultMode depends on the launch mechanism; SystemModeWithSharing enforces record sharing but not object or field permissions; SystemModeWithoutSharing can access all data. |
isAdditionalPermissionRequiredToRun |
When true, restricts launch access to enabled profiles or permission sets. Defaults to false; it does not determine data access. |
environments |
Launch compatibility: Default, Slack, or Offline. Offline permits only offline execution. |
start |
The launch event, record criteria, schedule, and scheduled paths. Its flowRunAsUser identifies the running user separately from runInMode. |
triggerOrder |
Record-triggered flow run order, from 1 to 2,000. It does not order elements within a flow. |
actionCalls |
Invocable actions, their input and output mappings, transaction handling, fault routes, and asynchronous completion controls. |
subflows |
Calls to other flows. flowName must be a flow API name without an appended hyphen and version number. |
variables |
Resource types and the calling contract. isInput and isOutput both default to false. |
recordCreates |
Record creation and optional create-or-update behavior through doesUpsert, matching-record operations, and upsert identifiers. |
recordLookups |
Get Records selection, sorting, result limits, output storage, and nested related-record retrieval. |
screens |
Screen components, validation, visibility, navigation, retained inputs, and screen-triggered actions. |
Behavior and Constraints
Launch permission and execution context
Permission to launch a flow and the permissions used during execution are separate. Setting isAdditionalPermissionRequiredToRun=true restricts who can launch it, but does not establish which records or fields it can access.
-
DefaultMode: The launch mechanism determines user or system context. It does not mean "always user context," so effective access cannot be determined from the flow definition alone. -
SystemModeWithSharing: Respects org-wide defaults, role hierarchies, sharing rules, manual sharing, teams, and territories. It does not respect object permissions, field-level access, or other running-user permissions. -
SystemModeWithoutSharing: Can access all data.
Within start, flowRunAsUser accepts TriggeringUser or DefaultWorkflowUser. This selects the running user; it is not the execution-context setting.
For processType=DataCaptureFlow, launching the flow makes its metadata publicly available in JavaScript format. Treat that definition as client-visible, not confidential server-only logic.
Flow type, triggers, and timing
processType=Flow identifies the screen-flow family. AutoLaunchedFlow means user interaction is not required; it does not, by itself, identify a record-triggered flow. If start.triggerType is omitted, the flow has no trigger and starts only when a user or application launches it.
Read the Start configuration as a combination:
-
triggerTypeestablishes the launch event or timing.RecordBeforeSavemakes updates to the triggering record before it is saved,RecordAfterSavestarts after saving, andRecordBeforeDeletestarts before deletion. -
object,recordTriggerType,filters,filterLogic, andfilterFormulaidentify the relevant records, changes, and entry criteria.filterFormulais specific to record-triggered flows. -
doesRequireRecordChangedToMeetCriteria=truerequires an update to move a record from not meeting the criteria to meeting them. It is not equivalent to running on every qualifying update. The same distinction applies to this setting on decision rules.
triggerOrder orders record-triggered flows, not their internal nodes.
environments=Default supports launch surfaces such as Lightning pages, Visualforce, flow actions, and custom Aura components. Slack supports Slack and the default environment. Offline permits only offline execution and must be selected for flow types that support offline flows.
For triggerType=Scheduled, start.schedule is required. Its startTime uses the org's default time zone. General schedule frequencies are Once, Daily, and Weekly. The additional values OnActivate, Hourly, Monthly, Weekdays, and Yearly are specific to segment-triggered flows.
A scheduled path is not a scheduled flow. Within start.scheduledPaths, timeSource selects RecordField or RecordTriggerEvent. Negative offsetNumber values run before that time; positive values run afterward. pathType=AsyncAfterCommit runs asynchronously after a save. Scheduled-path maxBatchSize ranges from 1 to 200 and defaults to 200.
A waits node waits only for events whose conditions qualify. If none qualify, it follows defaultConnector. The first qualifying event to occur supplies its connector; a wait-event failure follows faultConnector.
Execution order and calling contracts
Connectors establish execution order through targetReference, which identifies a node by its unique name, not its non-unique label. Canvas coordinates are layout data, not execution order. Auto-layout stores locationX and locationY as zero.
Two contained arrays have explicit ordering behavior: decisions.rules are evaluated in listed order, with the first true rule supplying the connector; otherwise, defaultConnector is used. assignments.assignmentItems execute in listed order starting at index zero.
For actionCalls, actionType determines how to interpret actionName. It can identify an invocable Apex method, another flow, a Quick Action, or a workflow email alert, among other action families. externalService invokes an operation exposed by a registered External Service schema. component requires an Aura component implementing lightning:availableForFlowActions; lwcComponent requires a Lightning web component targeting lightning__FlowAction.
Within actionCalls, actionType=flow is unavailable when processType is Flow or AutoLaunchedFlow. Use subflows instead. A subflow's flowName is not a version-pinned reference and cannot include an appended hyphen and version number.
Variables marked isInput form the incoming contract; variables marked isOutput expose results to callers. Both flags default to false. Disabling either flag on an existing variable can break callers even when the flow name is unchanged. Subflow inputAssignments apply at invocation, and outputAssignments apply when the called flow finishes.
storeOutputAutomatically makes supported outputs available through the element's API name instead of requiring manual variable mappings. Actions, subflows, record elements, and screen components support different mapping combinations. Generic action dataTypeMappings.typeName values require a T__ prefix for inputs and a U__ prefix for outputs.
Transactions, errors, and record operations
For an invocable action, flowTransactionModel controls transaction handling:
-
CurrentTransactionkeeps the action in the current transaction. -
NewTransactioncreates a transaction before executing the action. -
Automaticcreates a transaction when the action supports it and data manipulation language (DML), meaning record-write operations, is pending.
Error routing and rollback are distinct. Record operations and action calls expose faultConnector for error paths. recordRollbacks explicitly cancel pending record changes in the current transaction and are available only in screen flows. customErrors roll back the change that triggered a flow and present a custom error.
For asynchronous actions, isWaitUntilCompleted, offset, offsetUnit, timeoutConnector, and timeoutPathUsage control waiting and timeout handling. timeoutPathUsage accepts DisableTimeoutPath or EnableTimeoutPath. These settings are action-specific, not the flow's Start schedule.
A Create Records element is not necessarily insert-only. doesUpsert=true enables create-or-update behavior. upsertExternalIdField and upsertStandardIdField are mutually exclusive. doesUpsertAllOrNone defaults to true: a failure rolls back the transaction rather than saving successful records. With false, successful records can be saved.
Matching-record settings also change Create Records behavior. These are constrained strings, not arbitrary operation names:
-
operationMultMatchingRecords:None,UpdateAllRecords, orUpdateLatestRecord. -
operationOneMatchingRecord:NoneorUpdateAllRecords. -
operationZeroMatchingRecords:None.
For Get Records, selecting one record without both sortField and sortOrder selects from an unordered result. With storeOutputAutomatically=true, getFirstRecordOnly controls single-record storage. With automatic storage disabled, whether outputReference identifies a record variable or a record collection variable determines whether one or multiple records are stored.
Get Records supports outputAssignments and assignNullValuesIfNoRecordsFound only with automatic storage disabled. Its limit accepts 2 through 20,000 and requires getFirstRecordOnly=false. Automatic output storage for Get Records is supported when processType is Flow or AutoLaunchedFlow.
relatedRecords is a beta structure for retrieving related records. It can nest recursively, and each relationship requires relationshipField. Nested lookups can add object and field dependencies beyond the top-level Get Records object.
Screen validation, navigation, and choices
FlowInputValidationRule rejects input when formulaExpression evaluates to false. visibilityRule controls whether a component is rendered; it does not replace execution-context or permission controls.
- Disabling
allowBackmatters when revisiting an earlier screen would repeat an unwanted action.allowBackandallowFinishcannot both befalse. -
inputsOnNextNavToAssocScrndefaults toUseStoredValues.ResetValuesrefreshes inputs to incorporate changes elsewhere in the flow. - A Pause button requires the org's "Let users pause flows" setting,
allowPause=true, andshowFooter=true. Visualforce embedding also requiresshowAllowPause=trueon the embedding component.
Dynamic record choices and picklist choices have different contracts. A picklist choice requires picklistObject and picklistField and uses Picklist or Multipicklist data. It displays labels but stores API values. Record choices use record fields; displayField can differ from valueField. Dynamic choice sets have a maximum and default limit of 200, so they need not expose every matching record.
Multi-select screen fields store selected values as a semicolon-separated string and remove semicolons within individual selected values. For a Multipicklist assignment, AddItem inserts a separate item with its delimiter; Add appends text to the last item.
Screen actions are separate from actionCalls. Within screens, triggers and handlers select a FlowScreenAction through screenActionName. That action can invoke an autolaunched flow using actionType=flow. A handler's initBehavior can run the action without a triggering event: runOnLoad on the initial visit, or runOnRevisit when the user revisits through Next.
Orchestration and approvals
stages and orchestratedStages serve different purposes. stages are UI-progress resources used through $Flow.ActiveStages and $Flow.CurrentStage; stageOrder is not an orchestration execution sequence. orchestratedStages contain executable stageSteps, entry and exit requirements, and associated flows.
A step's actionType determines compatibility:
-
stepBackgroundsupports orchestrations and flow approval processes. -
stepInteractiveandstepMuleSoftare orchestration steps. -
stepApprovalis specific to flow approval processes.
EvaluationFlow evaluates custom orchestration entry and exit conditions. Only its isOrchestrationConditionMet output is used; other outputs are discarded. Consequently, entryActionName and exitActionName identify executable flow dependencies, not descriptive labels.
For group approval steps, requiresMultiMemberApproval is a string. "0" permits one group member, queue member, or delegate to approve or reject. "100" requires all group members or their delegates to approve; any rejection rejects the step.
Flow approval notifications can be suppressed with a processMetadataValues entry named SendNoApproverEmails. Its stringValue accepts case-insensitive true or false. Do not store personally identifiable information in outputConfigParams mock outputs used for rollback-mode debugging.
Segment-triggered flows
Segment entry and audience refresh are independent. start.entryType permits reentry Always, only AfterCompletion of previous runs of the same definition, or Never. publishSegment=true republishes the segment immediately before execution and ignores its Data Cloud publish schedule. With false, the publish schedule controls refresh; a "Do not refresh" schedule does not republish it.
start.activation is an activation record ID, whereas activationTemplate is a template name. When activationTemplate is set, sendMsgToOneContactPtPerIndv must be true. prioritizedContactPointsList is a comma-separated priority list using Email and Phone to select an individual based on available contact points. It is not a node execution sequence.
Deployment and Retrieval
The flow's fullName is versionless. An unversioned retrieval selects the latest flow version, not necessarily the active version. processType is determined from the active version, or from the latest version when none is active.
Metadata API files use the .flow suffix; source-format files use .flow-meta.xml. Filenames use the flow's unique name. Flow supports * in the package.xml manifest.
The unique name must begin with a letter and contain only alphanumeric characters and underscores. It cannot contain spaces, end with an underscore, or contain consecutive underscores. Spaces in filenames can cause deployment errors; leading and trailing spaces are removed during deployment.
status has UI mappings that can obscure the deployed state: Draft and Obsolete both appear as Inactive, InvalidDraft appears as Draft, and UnderReview appears as Under Review. Active identifies an active version. A missing status is treated as Draft during deployment or retrieval.
FlowDefinition is not required to deploy or retrieve a flow. If deployed, its active-version selection overrides the flow's status.
Changes to an active flow can be deployed in non-production orgs. Production requires the "Deploy processes and flows as active" preference. Deployment creates a new active version containing the changes; it does not modify the existing active version in place.
A flow version can be deleted only when inactive and without paused interviews. Paused interviews must resume and finish, or be deleted, before that version can be deleted.
Across flow versions, the only permitted processType conversion is Flow to AutoLaunchedFlow or the reverse, and the contents must support the destination type. Do not edit retrieved Process Builder metadata, including Workflow and InvocableProcess flows: deploying edited process metadata can make the process impossible to open in the target org.
Metadata API cannot access a flow installed from a managed package unless it is a template. isTemplate=true lets subscribers view the packaged template in a builder, clone it, and customize the clones. It does not grant unrestricted editing of the packaged original.
The record operations contained in a flow act on business records at runtime. They are not Metadata API create, retrieve, update, or delete operations on setup components.
Relationships
Dependencies extend beyond visible action and record nodes. Object types appear in variables, transformations, choices, and type mappings. Fields appear in filters, assignments, sorting, scheduled paths, screens, upsert identifiers, and nested related-record lookups. Formulas and resource expressions can embed field and label references. An elementReference can instead identify a local flow resource, so resolve it in context.
Incoming launch settings include QuickAction.flowDefinition, FlexiPage.value, AuthProvider.flow, MessagingChannel.sessionHandlerFlow, UserProvisioningConfig.flow, GenAiBundle.invocationTarget, and TransactionSecurityPolicy.flow. Bots, embedded-service configurations, workflow actions, and routing configurations can also select flows. Apex and Visualforce files can embed references in filedata.
Permission and muting entries, FlowTest.flowApiName, FlowCategory.flow, and Translations.fullName do not all represent runtime invocation. Actual callers, variable contracts, active-version selection, and destination configuration determine impact. A possible relationship alone does not establish usage or deployment order.
References
-
ApexClass:actionName,apexClass, including Apex-defined variables, transformations, plug-ins, and type mappings. -
CustomField:assignToFieldReference,assignToReference,displayField,elementReference,expression,field,fieldSelection,fieldText,filterFormula,interviewLabel,leftValueReference,objectFieldReference,outputFieldApiName,picklistField,queriedFields,recordField,relationshipField,sortField,upsertExternalIdField,upsertStandardIdField,valueField. -
CustomLabel:assignToReference,elementReference,expression,fieldText,filterFormula,interviewLabel,leftValueReference. -
CustomObject:object,objectType,outputSObjectType,picklistObject,relatedObject,typeValue. -
Flow:actionName,entryActionName,exitActionName,flowName. -
LightningBundle:extensionName. -
LightningWebComponent:extensionName. -
MarketSegmentDefinition:segment. -
QuickAction:actionName. -
WorkflowAlert:actionName. -
WorkflowRule:migratedFromWorkflowRuleName. This records migration origin, not trigger configuration.
Referenced By
ApexClass, ApexComponent, ApexPage, ApexTrigger, AppMenu, AuthProvider, BatchProcessJobDefinition, Bot, BotVersion, BotBlock, BotTemplate, CallCenter, ConvIntelligenceSignalRule, EmbeddedServiceConfig, EmbeddedServiceFieldService, FlexiPage, Flow, FlowCategory, FlowTest, GenAiBundle, MessagingChannel, MutingPermissionSet, OmniSupervisorConfig, PermissionSet, QuickAction, RecommendationStrategy, RecordActionDeployment, SvcCatalogFulfillmentFlow, TransactionSecurityPolicy, Translations, UserProvisioningConfig, Workflow, WorkflowFlowAction.
Documentation Inconsistencies
- The
processTypereference definesApprovalWorkflowandLoginFlowas approval and login flow types, but also lists both as reserved. That conflict makes the reference ambiguous about those values. -
runAsUseris documented onFlowOrchestratedStage, while the exposed element schema places it understageSteps. Its documented meaning is to run an asynchronous background step as the user who completed the most recent interactive step. Do not treat the two nesting locations as interchangeable.
Reported Issues
- Loop changes can be lost when updating the original collection. A 2022 discussion reported that changing the loop variable did not change the source collection. Adding modified records to a new collection preserved those changes for a later update. Loop collection discussion.
- Query-then-create logic can create duplicates during bulk inserts. An August 2023 report attributed duplicate Leads to separate interviews making the same lookup decision before their creates were bulkified. The suggested remedy was an invocable Apex action that deduplicates requests together, with an explicit policy for conflicting field values. Bulk interview discussion.
- Missing update executions after adding a callout can be an entry-criteria problem. A December 2023 discussion reported immediate-path callout rejection, followed by scheduled-path restrictions that led to transition-only entry criteria. An asynchronous path was suggested instead of a zero-offset scheduled path. This was a configuration diagnosis, not a rule that every callout requires that workaround. Callout path discussion.
- An entry formula can report an error involving a field that exists. A September 2023 discussion involved a referenced formula field that traversed relationships; inlining the underlying formula was reported as a workaround. This does not establish a blanket prohibition on formula-field references or prove a field-permission problem. Entry-formula discussion.
- Inaccessible nested Apex outputs can indicate a class-structure problem. A February 2025 discussion reported that inner wrapper classes were not usable as Apex-defined flow types and recommended top-level classes in separate files. Nested wrapper discussion.
- Tests that appear to outrun a deployed flow may instead be missing an active flow. An April 2023 change-set report found that a flow active in the source sandbox was inactive after deployment to another sandbox. The reporter resolved the failures by deploying and activating the flow before deploying the remaining change set. This was a reported destination-state issue, not evidence of a general timing delay. Change-set activation discussion.
Common Questions
Does retrieving a Flow return the active version?
Not necessarily. An unversioned retrieval returns the latest flow version, which can be inactive. The flow's versionless identity and its active-version selection are separate concerns.
Do I need FlowDefinition to deploy a flow as active?
No. FlowDefinition is not required for deployment or retrieval. If included, its active-version selection overrides the flow's status. Production deployment of changes to active flows requires the "Deploy processes and flows as active" preference.
Does SystemModeWithSharing enforce field-level security?
No. It respects record-level sharing, but not object permissions, field-level access, or other running-user permissions. Launch restrictions through isAdditionalPermissionRequiredToRun are a separate control.
Why does my record-triggered flow run on creation but not later updates?
One possible cause is doesRequireRecordChangedToMeetCriteria=true. It requires a transition from not meeting the criteria before an update to meeting them afterward. A record that already meets the criteria does not satisfy that transition merely by being updated.
Why can't I delete a flow version?
The version must be inactive and have no paused interviews. Resume and finish the paused interviews, or delete them, before deleting the version.