Configuring Key Entity Flows

Follow
The functionality described in this article is available as part of our Fiano release and will not be available if your Practifi instance is not upgraded to this release. 

Overview

Key Entity Flows allow you to automatically trigger Salesforce Flows when users create entities through the Create an Entity wizard. When a user selects a lifecycle stage (such as Client or Prospect), the wizard can automatically run one or more Flows to streamline the creation of entities and related tasks.

For example, Practifi Administrators can configure the Create an Entity wizard to automatically prompt users to create a relationship when a new Individual is promoted to Client status, or to launch a specific process workflow immediately after an Organization is created.

This article explains how to configure Flows to work with the Create an Entity wizard, what the wizard passes to Flows, and how to modify Flows that don't have a compatible input structure.

Please note: Configuring Key Entity Flows requires access to Salesforce Setup, specifically Custom Metadata Types and Flow Builder. This functionality is intended for Practifi Administrators with knowledge of Salesforce Flows. If you need assistance modifying Flows or configuring complex scenarios, contact Practifi Support.


How the Create an Entity Wizard Works With Flows

When a user creates a new entity using the Create an Entity wizard and selects a lifecycle stage, the wizard looks up matching records in the Key Entity Flow custom metadata type. Each matching record tells the wizard which Salesforce Flow to run and in what order.

The wizard passes the new entity's Record ID to the Flow using a placeholder called [DRAFT_ACCOUNT_ID]. This placeholder is replaced at runtime with the actual Salesforce Account ID of the entity being created.

Please note: The wizard can only pass a single record ID to a Flow. If a Flow requires multiple input variables or collection variables, it cannot be used directly and must be modified.


Accessing Key Entity Flow Configuration

Key Entity Flow configuration is stored in a custom metadata type accessible from Salesforce Setup:

  1. Go to Salesforce Setup by selecting the gear icon and then selecting Setup from the drop-down menu.

  2. In the Quick Find search, search for and select Custom Metadata Types.

  3. On the Custom Metadata Types page, find the Key Entity Flow in the list and click Manage Records.

  4. On the Key Entity Flows page, click the name of a Flow to view its record.

Each record in this metadata type maps a lifecycle stage (or other definition value) to a specific Flow. 

The fields on each record are:

Field Description Example
Label A human-readable name for this configuration record New Relationship
Definition Type The type of definition being matched (typically Client Stage) Client Stage
Definition Value The specific value that triggers this Flow when selected in the wizard Client
Flow API Name The API name of the Salesforce Flow to execute practifi__New_Record_Relationship
Flow Label The display name of the Flow (for reference) New Relationship
Sequence Order The execution order when multiple Flows are mapped to the same definition value (lower numbers run first) 2
Flow Input Variables A JSON string that maps the wizard's draft account ID to the Flow's input variable {"recordId":"[DRAFT_ACCOUNT_ID]"}

Understanding Flow Input Variables

The Flow Input Variables field is the most important part of the configuration. It tells the Key Entity wizard how to pass the new entity's ID into the target Flow.

The format is a JSON object where:

  • The key is the name of the Flow's input variable (for example, recordId)
  • The value is always [DRAFT_ACCOUNT_ID], which the wizard replaces with the actual Account ID at runtime

How to Find the Input Variable Name

To determine what to enter in the Flow Input Variables field, you need to check the Flow itself:

  1. In Salesforce Setup, use the Quick Find search to search for and select Flows.

  2. On the Flows page, click the name of the Flow you want to configure to open it in Flow Builder.
  3. Click the Debug button at the top of the Flow Builder screen.

  4. In the debug panel on the left, the Input Variables section displays the variable name to use in the JSON.

For example, if the debug panel shows "recordId", your Flow Input Variables value is:

{"recordId":"[DRAFT_ACCOUNT_ID]"}

Please note: The input variable must be a single record variable (accepting one record ID), not a collection variable (accepting a list of record IDs). If the debug panel shows a variable that expects a list or collection, the Flow cannot be used directly. See Identifying Incompatible Flows below.


Configuring a Compatible Flow

This section walks through a complete example of configuring a Flow to work with the Create an Entity wizard.

Scenario

A firm wants the Create an Entity wizard to prompt users to create a relationship (for example, linking a new Individual client to an existing Household) immediately after the entity is created with the lifecycle stage of Client.

Step 1: Verify the Flow's Input Variable

  1. In Salesforce Setup, use the Quick Find search to search for and select Flows.

  2. On the Flows page, scroll down and open the Practifi – New Record – Relationship Flow (API name: practifi__New_Record_Relationship).

  3. On the Flow Builder screen, click Debug.

  4. In the Input Variables section of the Debug panel, you should see a single variable: recordId.

  5. This confirms that the Flow accepts a single record ID, meaning it's compatible with the wizard.

Step 2: Create the Key Entity Flow Record

  1. In Salesforce Setup, use the Quick Find search to search for and select Custom Metadata Types.

  2. On the Custom Metadata Types page, find the Key Entity Flow in the list and click Manage Records.

  3. On the Key Entity Flows page, click New.

  4. Fill in the fields as follows:
Field Value
Label New Relationship
Key Entity Flow Name New_Relationship (auto-generated from Label)
Definition Type Client Stage
Definition Value Client
Flow API Name practifi__New_Record_Relationship
Flow Label New Relationship
Sequence Order 2
Flow Input Variables {"recordId":"[DRAFT_ACCOUNT_ID]"}
  1. Click Save.

Please note: The Sequence Order is set to 2 in this example because the Promote to Client Flow (Client Flow) runs first at Sequence Order 1. Multiple Flows mapped to the same definition value are executed in ascending sequence order.

Result

When a user creates an Individual entity and selects Client as the lifecycle stage, the Create an Entity wizard will:

  1. Run the Client Flow (Promote to Client) at Sequence Order 1.
  2. Run the New Relationship Flow at Sequence Order 2, passing the new entity's Account ID to the recordId variable.
  3. Display the relationship creation screen within the wizard.

Working with Multiple Flows

The Create an Entity wizard supports running multiple Flows in sequence for the same definition value. Each Flow gets its own Key Entity Flow record with a different Sequence Order number. Flows execute in ascending order (1, then 2, then 3, and so on).

For example, selecting Client as the lifecycle stage can trigger both a Promote to Client Flow (Sequence Order 1) and a New Relationship Flow (Sequence Order 2). Both run automatically in sequence as part of the wizard's completion steps.

To configure multiple Flows:

  1. Create a separate Key Entity Flow record for each Flow, as shown above.
  2. Use the same Definition Type and Definition Value for all Flows that should trigger together.
  3. Assign each Flow a unique Sequence Order number to control execution order.
  4. Ensure each Flow has its own Flow Input Variable that matches its input variable name.

Identifying Incompatible Flows

Not all Flows can be used directly with the Create an Entity wizard. The wizard can only pass a single record ID to a Flow. If a Flow's input structure expects something different, it needs to be modified before it can be configured.

How to Identify Incompatible Flows

Open the Flow in Flow Builder and click Debug. If the Input Variables section shows any of the following, the Flow cannot be used directly:

  • Collection variables: A collection variable accepts a list of records (for example, a variable called "asset liability list")
  • Non-ID variables: Variables that expect non-ID values (for example, a variable called "processRelatedTo" that maps to an entity relationship rather than a direct Account ID)
  • No input variables: The Flow has no input variables at all

Example: New Record Process Flow

The Practifi – New Record – Process Flow (practifi__New_Record_Process) is an example of a Flow that does not work directly. When you open it in Debug mode, the input variable shown is "processRelatedTo", and the Flow's internal actions use collection variables (such as "asset liability list") to look up related process types.

Because the wizard can only pass a single record ID, it cannot map to the structure this Flow expects. To make it work, the Flow would need to be modified to accept a single record ID input variable and derive the other values internally.


Modifying Flows for Compatibility

If a Flow does not have a compatible input structure, it must be modified before it can be used with the Create an Entity wizard. The modification involves adding or changing the Flow's input variable to accept a single record ID.

General Approach

  1. Open the incompatible Flow in Flow Builder.
  2. Create a new input variable (or modify the existing one) to accept a single record ID.
  3. Name the variable something descriptive, such as recordId or accountId.
  4. Set the variable's Data Type to Text and mark it as Available for input.
  5. Update the Flow's logic to use this input variable to derive any other values it needs (such as looking up related records or retrieving collection data).
  6. Save and activate the Flow.
  7. Test the Flow by running it with a sample Account ID to verify it works correctly.

Please note: Modifying Flows requires familiarity with Salesforce Flow Builder and an understanding of the Flow's existing logic. This task is intended for Practifi Administrators who are experienced with Flows. If you need assistance modifying a Flow to work with the Create an Entity wizard, contact Practifi Support.

Compatibility Summary

Flow Type Input Structure Compatible? Action Required
Flow with a single record ID input variable Single variable (e.g., recordId) Yes Configure directly via Key Entity Flow metadata
Flow with collection or multi-record input variables Collection variable (e.g., asset liability list) No Flow must be modified to accept a single record ID
Flow with no input variables None No Flow must be modified to accept a single record ID input

Key Entity Type Availability

A separate custom metadata type, Key Entity Type Availability, controls which entity types (Individual, Household, Organization, Group) are available in the Create an Entity wizard. This is managed through the Available Types tab on the Entity Management page in the Settings app and does not typically require direct metadata configuration.

Administrators should use the Entity Management page to toggle entity types on or off rather than editing the metadata records directly. For instructions on how to do this, see Configuring Entity Management Settings.


Known Limitations

When configuring Key Entity Flows, be aware of the following limitations:

  • The Key Entity wizard can only pass a single record ID to a Flow via the [DRAFT_ACCOUNT_ID] placeholder. Flows requiring multiple input values or collection variables are not supported without modification.
  • If an entity is not successfully created (for example, the user cancels the creation), the draft account ID is cleaned up, and the Flow does not execute.
  • The Flow Input Variables field must contain valid JSON. Malformed JSON will cause the Flow to fail silently.
  • There is no validation in the metadata configuration that checks whether the referenced Flow exists or has an active version. If the Flow API Name is incorrect or the Flow is inactive, the Create an Entity wizard will display an error at runtime.
  • Key Entity Flow configuration requires direct access to Salesforce Setup and Custom Metadata Types. These settings cannot be configured through the Practifi Settings app.
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.