web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Automatically change the Business Process Flow (PBF)

(3) ShareShare
ReportReport
Posted on by 120
Hello together,
 
I am currently working on a topic regarding the Business Process Flow (BPF) on the lead entity.
 
We use the default BPF "Lead-to-opportunity marketing sales process" (Marketing BPF) and the "Lead to Opportunity Sales Process" (Sales BPF). 
We would like to automatically change the marketing BPF to the Sales BPF as soon as the last stage of the marketing BPF is finished. The background is that we want to save the four clicks to change the BPF. Last stage:
 
Ideally I would like to achieve the whole thing without coding. For example with the help of a workflow.
Does anyone here already have experience and can tell me the best way to do this?
 
Thank you very much in advance.
 
Best regards
 
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,530 Super User 2025 Season 2 on at
    Good morning, afternoon, or evening depending on your location!
    To automatically change the Business Process Flow (BPF) from the "Lead-to-opportunity marketing sales process" to the "Lead to Opportunity Sales Process" upon completion of the last stage, you can achieve this without coding by using Power Automate or Dynamics 365 workflows. Here's how:
    Option 1: Using Power Automate
    1. Trigger: Set up a flow that triggers when the last stage of the Marketing BPF is completed. You can use the "When a record is updated" trigger for the Lead entity.
    2. Condition: Add a condition to check if the current stage is the last stage of the Marketing BPF.
    3. Action: Use the "Update a row" action to change the active BPF to the Sales BPF. You'll need the businessprocessflowinstanceid and processstageid values for this step.
    Option 2: Using Dynamics 365 Workflows
    1. Create a Workflow: Build a workflow for the Business Process Flow entity.
    2. Trigger: Configure the workflow to run when the "Sales Accepted" field is set to "Yes" (as shown in the image you provided).
    3. Update Active Stage: Use the workflow to update the active stage and switch the BPF to the Sales process.
    Both methods allow you to automate the transition without requiring custom code. For detailed steps, you can explore this guide or this article.
     
     
    Hope this helps!
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,835 Super User 2025 Season 2 on at
    Hello MichaelFo96,
     

    Yes, it is absolutely possible to automatically change the Business Process Flow (BPF) on the Lead entity from the "Lead-to-opportunity marketing sales process" to the "Lead to Opportunity Sales Process" when the last stage of the marketing BPF is completed, and you can achieve this without writing any code by using a Workflow.

    Here's the best way to do this:

    Steps to Create the Workflow:

    1. Navigate to Settings > Processes:

       

      • Go to your Dynamics 365 environment.

      • Click on the Settings gear icon in the top right corner.

      • Select Advanced Settings.

      • In the new window, navigate to Settings > Process Center > Processes.

    2. Create a New Workflow:

      • On the Processes page, click New.

      • In the "Create Process" dialog:

        • Process name: Enter a descriptive name (e.g., "Auto Switch Lead BPF to Sales").

        • Entity: Select Lead.

        • Category: Select Workflow.

        • Type: Ensure New blank process is selected.

        • Uncheck the "Run this workflow in the background" option. We want this to happen in real-time.

        • Click OK. 
         

    3. Configure the Workflow Trigger:

       

      • In the Workflow editor, under "Start when," select the checkbox for Record status changes.

      • Click the Select button next to the "Record status changes" option.

      • In the "Select Entity and Attributes" dialog:

        • Entity: Lead (should be pre-selected).

        • Attribute: Select Active Stage (activestageid).

        • Click OK. 

      • Now, click the Add Step dropdown and select Check Condition.

      • In the "Check Condition" step, click on (click to specify conditions).

      • Define the condition to check if the current active stage of the "Lead-to-opportunity marketing sales process" (Marketing BPF) is the last stage. You'll need to know the name or ID of the last stage. Let's assume the last stage is named "Marketing Qualification Complete".

        • In the condition editor:

          • In the first dropdown, select Active Stage.

          • In the second dropdown, select Equals.

          • In the third dropdown, enter the exact name of the last stage of your Marketing BPF ("Marketing Qualification Complete"). 

        • Click Save and Close.  

    4. Add a Step to Update the Business Process Flow:

      • Click Add Step below the "Check Condition" step.

      • Select Update Record.

      • In the "Update Record" step, click on (click to specify conditions).

      • In the "Set Properties" dialog:

        • In the "Look For" dropdown, Lead should be selected.

        • Scroll down and find the field Process (processid).

        • Click on the field and in the lookup window, select the "Lead to Opportunity Sales Process" (Sales BPF).

        • Click Save and Close. 
         

    5. Add a Step to Update the Status of the Marketing BPF Instance (Optional but Recommended):

      • Click Add Step below the "Update Record" step.

      • Select Update Record.

      • In the "Update Record" step, click on (click to specify conditions).

      • In the "Look For" dropdown, select Process Session.

      • In the "Regarding (Set Value)" section, select (Regarding) and choose Lead (Lead) from the flyout menu.

      • Add a condition:

        • In the first dropdown, select Process Name.

        • In the second dropdown, select Equals.

        • In the third dropdown, enter the exact name of the "Lead-to-opportunity marketing sales process" (Marketing BPF). 

      • In the "Set Properties" dialog:

        • Find the field Status Reason (statecode).

        • Set it to Completed.

        • Click Save and Close. This step helps to mark the Marketing BPF instance as finished. 
         

    6. Save and Activate the Workflow:

      • Click Save in the Workflow editor.

      • Click Activate on the command bar.

      • Confirm that you want to activate the workflow by clicking OK.


      •  

    7.  

    Explanation:

    • Trigger: The workflow will start whenever the "Active Stage" of a Lead record changes.

    • Condition: It will then check if the new "Active Stage" is the last stage of your "Lead-to-opportunity marketing sales process".

    • Update Record (BPF): If the condition is met, it will update the "Process (processid)" field on the Lead record to the "Lead to Opportunity Sales Process", effectively switching the BPF.

    • Update Record (BPF Instance): The optional but recommended second "Update Record" step finds the specific instance of the Marketing BPF associated with the Lead and sets its status to "Completed".


    •  

    Important Considerations:

    • Exact Stage Name: Make sure you use the exact name of the last stage of your "Lead-to-opportunity marketing sales process" in the "Check Condition". Case sensitivity might apply.

    • Order of Operations: Ensure this workflow runs after any other workflows that might be updating the active stage. You can adjust the order of workflows in the Processes grid.

    • Testing: Thoroughly test this workflow in your environment to ensure it triggers correctly and switches the BPF as expected when the last stage of the Marketing BPF is reached.

    • User Experience: This automation will seamlessly transition users to the Sales BPF without requiring them to manually change it.


    •  

    This workflow approach should perfectly meet your requirement of automatically changing the BPF without writing any code, saving your users those four clicks! Good luck!

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • MichaelFo96 Profile Picture
    120 on at
    Hello together,
     
    I've tried both of your approaches but none of them work :( 
     
    @Daivat Vartak:
    Regarding your 4th Step. I can't find the field "Process (processid)" on the Lead Entity. Neither in the workflow nor in the Power Apps directly on the table.
     
    @Holly Huffmann:
    Can you please show me exactly how to change the BPF? The links you mentioned only describes a change of the stages of a BPF.
     
    Thank you both in advance.
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,373 Most Valuable Professional on at

    You cannot switch Business Process Flows (BPFs) using classic workflows in Dynamics 365. However, you can achieve this without coding by using Power Automate (Flow).

    Recommended No-Code Approach:

    Use Power Automate to:

    1. Trigger when the Marketing BPF reaches its final stage.

    2. Update the BPF ID on the same Lead record to switch to the Sales BPF.

    Steps:

    • Use the When a row is modified trigger (Dataverse connector).

    • Check if the BPF is Marketing BPF and if Active Stage = Final Stage.

    • Use the Perform an unbound action: SetProcess to switch to the Sales BPF.

     Reference:

  • Suggested answer
    MichaelFo96 Profile Picture
    120 on at
    Hello Muhammad,
     
    I've tested your mentioned way and the power automate flow run correctly but it did not changed the BPF in the UI. Therefore I've read the documentation again and found out that the "SetProcess" is not supported anymore.
    (On Prem Documentation):
     
    Microsoft mention in the Power Automate Documentation to use client APIs for these scenarios:
     
    Therefore it looks like that it is not possible without coding...
     
    Thank you all.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans