Flows

To let a user configure a Flow Instance, call the openConfiguration method:

await integrationApp
  .connection('hubspot')
  .flow('{FLOW_KEY}')
  .openConfiguration()

Flow Instance editor

To edit a Flow Instance, call the openEditor method:

await integrationApp
  .flowInstance('{FLOW_INSTANCE_ID}')
  .openEditor()

Alternatively, you can embed the Flow Instance editor directly into a specific element:

function FlowBuilderEmbedding() {
  const targetId = 'flow-builder-emdedding'
  const integrationApp = useIntegrationApp()
  const targetRef = useRef<HTMLDivElement>(null)

  useEffect(() => {
    void integrationApp
      .flowInstance({
        flowKey: parameters.FLOW_KEY,
        integrationKey: parameters.INTEGRATION_KEY,
        autoCreate: true,
      })
      .embedEditor({
        mountTargetSelector: `[data-container-id="${targetId}"]`,
      })
  }, [
    parameters.FLOW_KEY,
    parameters.INTEGRATION_KEY,
    integrationApp
  ])

  return (
    <div
      style={{ height: '490px' }}
      data-container-id={targetId}
      ref={targetRef}
    ></div>
  )
}

See Also