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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Programmatically turn ...
Power Automate
Unanswered

Programmatically turn on a new programmatically created flow

(0) ShareShare
ReportReport
Posted on by 19

Hi all,

 

I created a solution-aware flow programmatically. The issue is even if I set the 'statcode' to 1 the newly created flow is turned off.

So I thought, I used the 'Turn on flow' action to enable the flow, but I run into the following error:

 

{
"error": {
"code": "CannotStartUnpublishedSolutionFlow",
"message": "An unpublished solution flow cannot be activated. Please authenticate the flow connections and save the flow to enable activation."
}
}
 
When I turn on the flow manually in the UI I have no issue and don't need to publish the customisation in the solution first either.
 
Any idea what is missing?
 
Many thanks!
 
 
 

 

 

Categories:
I have the same question (1)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at
    Re: Programmatically turn on a new programmatically created flow

    Do you get the same error when creating a flow that doesn't contain connections? So for example create a flow with just a compose action saying "Hello world". Would this work? My guess is that there is a problem with the connection references which are normally set during deployment or saving. Do you use any connection references in the flow? Are they set correctly?

  • Christoph007 Profile Picture
    19 on at
    Re: Programmatically turn on a new programmatically created flow

    Hi @Matthy79 

     

    Thank you for coming back to me.

     

    The answer to all of your questions is yes.

    - Yes, I have connections

    - Yes, they are configured correctly

    - Yes, I get the same error with a flow without any connections

     

    I also tried the following:

    - Create flow programmatically

    - Manually published the customizations in the solution

    - Run a flow to just turn this flow on

     

    I got the same error:  'An unpublished solution flow cannot be activated. Please authenticate the flow connections and save the flow to enable activation.'

     

    I do this in a development environment, could it be that this action is limited to prod environment only?

     

    Any ideas?

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard