## Flows configuration Before you begin - To get the most out of **Flows**, review the [overview section](/ciam/guides/integrations/flows/overview) to understand their impact on user journeys. - Prehooks and webhooks can be created either in the backoffice (Prehook/Integrations tabs) or directly within flows. If created in a flow, they’ll also appear in the backoffice. - Extend flow capabilities by creating **sub-flows**, reusable across multiple flows. ### Getting started To customize your first flow, go to the Frontegg portal and select the desired environment from the dropdown at the top of the screen. Then navigate to **Flows**. The dashboard will display available user flows with ready-made templates. Choose a template to begin customization. You can either modify the flow manually or use the **AI prompt** (e.g., "Create a login flow that enrolls users in MFA only during their initial login") to auto-generate the required steps. ### Flow builder Building a flow involves three main steps: 1. **Choose a flow** 2. **Customize it with hooks and sub-flows** 3. **Test and publish** ### Step 1: Choose a flow First, from the dropdown, select the desired environment. Then navigate to Build → Flows. Frontegg offers pre-built flows for common actions, such as: - User sign-up - User updates - User deletion - User invite - User login (password, OIDC/SAML, social) ![flows-configuration-1](/assets/flows-configuration-1.1b0f0d2c3ef26fbe241526483d52e10ace46ad5e916bcaaf1722163f169302da.729be269.png) ### Step 2: Customize with hooks and sub-flows Once a flow is selected, you’ll see branches with **`+`** icons at strategic points. - **Dotted lines** indicate where you can add a **webhook**. - **Solid lines** indicate that you can add a **prehook** or a **sub-flow**. ![flows-configuration-2](/assets/flows-configuration-2.443216b45d1d68d0c8009ffb943b2faafd1c32990e1e7e7e56472aa708c29f0a.729be269.png) #### Options for customization: - Add steps manually, or - Use the **AI prompt** to describe your requirements. When you click a **`+`**, a side panel will open with available options. Re-using hooks Hooks created in one flow (e.g., a JWT token prehook) will remain identical if reused in other flows. Ensure compatibility across all flows using shared hooks. Provide the necessary information for your webhook, prehook, or sub-flow. When done, click **Save**. ![flows-configuration-3](/assets/flows-configuration-3.bd8e6011363ced0590758db471b088c256ff6f85db4ca63f008b532d0703f128.729be269.png) ### Creating sub-flows Sub-flows extend flow functionality, allowing for reusable, independent mini-flows. - Sub-flows execute based on specific conditions within the parent flow. - You can add **logic** (true/false), **web requests** (synchronous/asynchronous), or **custom code**. ![flows-configuration-4](/assets/flows-configuration-4.6cfca7ca094eca23ad49c7267038155592af86614d77fca3021bce29909efd7b.729be269.png) #### Adding sub-flows: 1. Click **`+`**, then choose **Create new sub-flow** or select an existing one from the **Sub-flows** tab. 2. Customize the sub-flow and save it for reuse. ![flows-configuration-5](/assets/flows-configuration-4.6cfca7ca094eca23ad49c7267038155592af86614d77fca3021bce29909efd7b.729be269.png) #### Testing sub-flows: After designing your sub-flow: - Use **Run test** to validate its logic. - Review test results and refine as needed. ![flows-configuration-6](/assets/flows-configuration-6.80fa0f1d5d2a8a3faee20bb37dbd2ef4bb2b6bd5c84678eb221d649a0e029f4f.729be269.png) ### Step 3: Test and publish After customizing your flow, use **Run test** to ensure logic accuracy. - Review results displayed on the left panel. - Once satisfied, click **Publish** to activate the flow. br Sub-flows testing Sub-flows are tested separately. See previous section to learn more. ### Prehooks, webhooks, and published changes Hooks created within flows are synced with the **Prehooks/Integrations** tabs. Changes in one location will reflect in the other: - Disabling a hook in the backoffice will tag the flow with **"unpublished changes"**. - Hooks in published flows will automatically appear as **Enabled** in Integrations. ![flows-configuration-7](/assets/flows-configuration-7.2850ca6b3d2162af57db1aa00aabc93f0ba39ef14688852cd083e1d6832cf522.729be269.png) ### Audit logs All user activity within flows is logged for review in your audit logs.