Embed Lightning Screen Flows
on any website.
Use a Salesforce Site + FlowIframeEmbed to run Lightning Runtime flows in an iframe, pass explicit URL inputs, and redirect on completion.
View documentation WordPress plugin JavaScript widget Live demo
Try the JavaScript widget
This embed loads Expanding_Flow from our public Salesforce Site demo org via
three-levers-flow-embed.js. The iframe resizes automatically as you move through screens.
Pass inputDivCount on the URL—for example
?inputDivCount=7.
Completing the flow redirects to iframe-finish-demo.
What you get
- Flows run in Lightning Runtime.
- Auto height via
frameHeightpostMessage. - Flow inputs from URL params using
inputVarsallowlist. - Finish redirect with
endUrl.
Core pieces
- FlowIframeEmbed package in Salesforce
- FlowIframeEmbed Visualforce page (
three_levers__FlowIframeEmbed) on a public Site atsite-prefix/apex/three_levers__FlowIframeEmbed - Screen Flow (activated, API name known)
- three-levers-flow-embed.js for non-WordPress sites
- WordPress plugin with settings defaults + shortcode
High-level setup
- Install FlowIframeEmbed in Salesforce.
- Create and activate your Screen Flow; note the API Developer Name.
- Add FlowIframeEmbed to a Salesforce Site and configure guest access.
- Allow your parent domain in clickjack/CSP settings.
- Embed with the WordPress plugin or JavaScript widget.
Flows, Sites, and guest permissions are configured per org—they are not bundled in the package.
WordPress plugin
Version 1.1.0+ adds FlowIframeEmbed embed mode: configure defaults under Settings → Lightning Flow iFrame, then drop a bare shortcode on any page.
Bare shortcode
When defaults are set for iFrame URL, flow name, and optional end URL:
[Lightning-Flow-iFrame]
Optional flow inputs when your Screen Flow accepts URL variables:
[Lightning-Flow-iFrame inputvars="recordId,source" extraqs="recordId=001xxx&source=homepage"]
Get the plugin
- Auto height via
frameHeightpostMessage - Embed mode:
flow,endUrl, optionalinputVars - Legacy mode preserved when Default Flow Name is blank
JavaScript widget (non-WordPress)
Define window.tlFlowEmbed before loading the script. The widget builds flow, endUrl, and inputVars query strings automatically.
window.tlFlowEmbed = {
embedUrl: 'https://threelevers.my.salesforce-sites.com/demo/apex/three_levers__FlowIframeEmbed',
flow: 'Expanding_Flow',
endUrl: 'https://threelevers.com/iframe-finish-demo',
inputVars: ['inputDivCount'],
params: { inputDivCount: '3' },
height: '75px',
heightPadding: 20,
ease: true,
easeSpeed: 0.2,
allowedOrigin: 'https://threelevers.my.salesforce-sites.com'
}; <script src="https://cdn.jsdelivr.net/gh/jason-best/lightning-flow-iframe@latest/embed/three-levers-flow-embed.js" type="text/javascript"></script> Hosted copy: https://threelevers.com/assets/embed/three-levers-flow-embed.v1.js
Implementation checklist
- Public Site URL loads without Salesforce login.
- Iframe renders flow using API Developer Name.
- Dynamic resize works (no clipped screens).
inputVarsand flow variable names match exactly.endUrlredirects when flow reachesFINISHED.- Guest user can complete all intended paths.