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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Turn Flows On or Off u...
Power Automate
Unanswered

Turn Flows On or Off using REST API

(0) ShareShare
ReportReport
Posted on by 79

Hi,

 

I am creating a Power Automate flow to turn off some scheduled flows during off hours and turn them on during work hours.

Is there any REST API for Power Automate that I can use to turn flows on and off?

There is an Update Flow action in Power Automate, but the documentation is scarce.

 

iBro_0-1700798601966.png

 

 

Categories:
I have the same question (0)
  • iBro Profile Picture
    79 on at

    Ok. So, I found where I should get the Flow Definition value from. It came from previous Get Flow action.

    But, after I add it, I got an error that says:

     

     

    Spoiler (Highlight to read)
    Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The 'inputs' of workflow run action 'Get Items' of type 'OpenApiConnection' should not have the property 'authentication'.'."}}".
    Code: 0x80060467
    InnerError: '.
    Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The 'inputs' of workflow run action 'Get Items' of type 'OpenApiConnection' should not have the property 'authentication'.'."}}".Code: 0x80060467InnerError: '.

     

    I searched around and found a post which suggests to remove the authentication properties and so I did by converting the Flow Definition to string and replace the authentication property and it's value with empty string and then convert back to object using json() function.

     

    iBro_0-1700808814160.png

     

     

    However, after I removed all the authentication properties, I got another error related with connection references.

     

    Spoiler (Highlight to read)
    Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'WorkflowRunActionInputsMissingProperty' and message 'The 'inputs' of workflow run action 'Get Items' of type 'OpenApiConnection' is not valid. Property 'host.connectionReferenceName' is missing.'."}}".
    Code: 0x80060467
    InnerError: '.
    Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'WorkflowRunActionInputsMissingProperty' and message 'The 'inputs' of workflow run action 'Get Items' of type 'OpenApiConnection' is not valid. Property 'host.connectionReferenceName' is missing.'."}}".Code: 0x80060467InnerError: '.

    So, I insert Connection References from Get Flow action.

     

    iBro_1-1700809417187.png

     

    and I stumbled onto another error.

    Right now I am completely stuck.

     

    Spoiler (Highlight to read)
    The 'inputs.parameters' of workflow operation 'Update_Flow' of type 'OpenApiConnection' is not valid. Error details: The API operation does not allow writing a value for parameter 'Flow/properties/connectionReferences[0]/displayName'. This parameter is read only.
    The 'inputs.parameters' of workflow operation 'Update_Flow' of type 'OpenApiConnection' is not valid. Error details: The API operation does not allow writing a value for parameter 'Flow/properties/connectionReferences[0]/displayName'. This parameter is read only.

     

     

     

     

  • iBro Profile Picture
    79 on at

    Finally!

    Removing displayName property from all the connectionReferences works.

    Still looking another easier way to toggle the state though.

    I do not have access to CDS/Dataverse so, the only alternative that I can think of is by using REST API call (if there is any).

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard