function startFlow() { $Lightning.use("runtime_appointmentbooking:lightningOutGuest", // name of the Lightning app function() { $Lightning.createComponent("lightning:flow", // top-level component of your app {}, // attributes to set on the component when created "lightningLocator", // the DOM location to insert the component function(cmp) { console.log('Hi from callback'); // callback when component is created and active on the page cmp.startFlow('Inbound_New_Guest_Appointment_V2'); } ); }, 'https://elitehealthonline1.my.site.com' // Community endpoint ); }