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 Automate - Building Flows
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!
 
 
 

 

 

I have the same question (1)
  • Matthy79 Profile Picture
    4,178 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

Responsible AI policies

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 560 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 347 Moderator

#3
Expiscornovus Profile Picture

Expiscornovus 262 Most Valuable Professional

Last 30 days Overall leaderboard