1

I have requirement to activate flow using tooling API { Not through deployment }

I am trying to use below endpoint with body

services/data/v56.0/tooling/sobjects/Flow/{Id}

Response 
{
  "Metadata":  {
    "status": "Active"
} 
}

I am getting below Error { Please help if any one is aware }

[ { "message": "The version of the flow you're updating is active and can't be overwritten.", "errorCode": "INVALID_STATUS", "fields": [] } ]

1
  • Can you please share what is the request body and what is the method you are using? Commented Apr 25, 2023 at 7:45

1 Answer 1

2

Try using flowDefinition

/services/data/v57.0/tooling/sobjects/flowDefinition/3006F0000005wMkQAI

PATCH:

{ 
"Metadata": { "activeVersionNumber" : "1" }
 }

enter image description here

To deactivate, set activeVersionNumber to 0.

Note: While FlowDefinition's tooling API access is partially deprecated, you can still use it for Activate/Deactivate operations. If you are updating the entire metadata(along with Active status), you can use Flow with Active flag flipped on. If not, FlowDefinition is the API that you need to use.

2
  • 1
    It seems it was permission issue working fine now Commented Apr 26, 2023 at 11:29
  • Also is there way to update using tooling API using sfdx CLI Commented Apr 26, 2023 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .