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

Error while trying to run flow

(0) ShareShare
ReportReport
Posted on by
I'm working on a flow to get list items on a daily basis, if a condition is met then a team's message gets posted in a chat with a flow bot. This should be a simple flow (I think) and I have made it before with no issues, but I get a long error that CoPilot cannot figure out and neither can I. My older flow that used to work is also failing now. Can anyone tell me what I am doing wrong? Error below. 
 
{"message":"Request failed with status code 400","name":"AxiosError","code":"ERR_BAD_REQUEST","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","accept-language":"en-US","x-ms-client-session-id":"b80c6de0-c959-11f0-82a3-e92108ea875d","x-ms-client-request-id":"991a3a99-e5dd-4fd7-a7a8-f7208c412670","authorization":""},"operationName":"PROCESSSIMPLE:PATCH/PROVIDERS/MICROSOFT.PROCESSSIMPLE/ENVIRONMENTS/FLOWS/","params":{"api-version":"1","$expand":"properties.connectionreferences.apidefinition,properties.definitionsummary.operations.apioperation,operationDefinition,plan,properties.throttleData,properties.estimatedsuspensiondata,properties.licenseData,properties.billingContext,properties.throttlingBehavior,properties.powerFlowType,properties.protectionStatus","telemetryMetadata":"{\"modifiedSources\":\"Portal\"}"},"method":"patch","url":"https://02094c855e0be56683be539567634c.15.environment.api.powerplatform.com/powerautomate/flows/323ba253-2622-4ec3-a16b-ac0bbd8c0de5","data":"{\"properties\":{\"connectionReferences\":{\"shared_sharepointonline\":{\"id\":\"/providers/Microsoft.PowerApps/apis/shared_sharepointonline\",\"connectionName\":\"shared-sharepointonl-61f4add4-143b-4ec0-9e3a-49124128ae48\",\"source\":\"Embedded\"},\"shared_teams\":{\"id\":\"/providers/Microsoft.PowerApps/apis/shared_teams\",\"connectionName\":\"shared-teams-c48db00a-b23a-478b-9257-25ab378ee258\"}},\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"contentVersion\":\"1.0.0.0\",\"parameters\":{\"$authentication\":{\"defaultValue\":{},\"type\":\"SecureObject\"},\"$connections\":{\"defaultValue\":{},\"type\":\"Object\"}},\"triggers\":{\"Recurrence\":{\"type\":\"Recurrence\",\"recurrence\":{\"interval\":1,\"frequency\":\"Week\",\"timeZone\":\"Central Standard Time\",\"schedule\":{\"weekDays\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\"],\"hours\":[\"9\"]}}}},\"actions\":{\"Get_items\":{\"type\":\"OpenApiConnection\",\"inputs\":{\"parameters\":{\"dataset\":\"https://cagrecipe.sharepoint.com/sites/ConagraCB\",\"table\":\"60df70af-33c6-48b7-a664-928ab144eb05\"},\"host\":{\"apiId\":\"/providers/Microsoft.PowerApps/apis/shared_sharepointonline\",\"operationId\":\"GetItems\",\"connectionName\":\"shared_sharepointonline\"}},\"runAfter\":{}},\"For_each\":{\"type\":\"Foreach\",\"foreach\":\"@outputs('Get_items')?['body/value']\",\"actions\":{\"Condition\":{\"type\":\"If\",\"expression\":{\"and\":[{\"equals\":[\"@items('For_each')?['Status/Value']\",\"In Supply\"]}]},\"actions\":{\"Post_message_in_a_chat_or_channel\":{\"type\":\"OpenApiConnection\",\"inputs\":{\"parameters\":{\"poster\":\"Flow bot\",\"location\":\"Chat with Flow bot\",\"body/recipient\":\"@items('For_each_1')?['Email']\",\"body/messageBody\":\"<p class=\\\"editor-paragraph\\\">Test 4</p>\"},\"host\":{\"apiId\":\"/providers/Microsoft.PowerApps/apis/shared_teams\",\"operationId\":\"PostMessageToConversation\",\"connectionName\":\"shared_teams\"}}}},\"else\":{\"actions\":{}}}},\"runAfter\":{\"Get_items\":[\"Succeeded\"]}}},\"outputs\":{}},\"displayName\":\"Order in Supply Reminder\",\"environment\":{\"name\":\"02094c85-5e0b-e566-83be-539567634c15\"}},\"name\":\"323ba253-2622-4ec3-a16b-ac0bbd8c0de5\",\"telemetryMetadata\":{\"modifiedSources\":\"Portal\"}}","team":"PowerAutomate","bodyDetails":{"locale":"en-US"},"axios-retry":{"retryCount":0,"lastRequestTime":1764010730048},"context":{"ppapiContext":{"endpoint":"02094c855e0be56683be539567634c.15.environment.api.powerplatform.com"}},"knownServiceId":"ppapi-pauto","activityId":"a3105141-81d9-4a54-9acd-df66408ed235"},"request":{},"response":{"data":{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'For_each_1' referenced by 'inputs' in action 'Post_message_in_a_chat_or_channel' are not defined in the template.'.'."}},"status":400,"statusText":"","headers":{"access-control-allow-origin":"*","access-control-expose-headers":"Content-Type,Date,Server,Access-Control-Allow-Origin,Access-Control-Expose-Headers,Content-Length,x-ms-ppapigateway,x-ms-gateway-clusters,x-ms-request-id,x-ms-correlation-request-id,x-ms-flow-mobile-ios-version,x-ms-armresiliency,x-ms-flow-routing-request-id,Strict-Transport-Security","cache-control":"no-cache, no-store","content-length":"286","content-type":"application/json; charset=utf-8","date":"Mon, 24 Nov 2025 18:58:52 GMT","strict-transport-security":"max-age=31536000; includeSubDomains","x-ms-armresiliency":"False","x-ms-correlation-request-id":"54c619dc-f6d5-4d69-86b0-99a4ad1dc549","x-ms-flow-mobile-ios-version":"3.0.421","x-ms-flow-routing-request-id":"EASTUS:20251124T185852Z:d7bdcc30-ee77-47aa-a00e-7bf28e7282d9","x-ms-gateway-clusters":"prdil108eus","x-ms-ppapigateway":"_prdil108eusgb0_6","x-ms-request-id":"eastus:d7bdcc30-ee77-47aa-a00e-7bf28e7282d9"},"config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","accept-language":"en-US","x-ms-client-session-id":"b80c6de0-c959-11f0-82a3-e92108ea875d","x-ms-client-request-id":"991a3a99-e5dd-4fd7-a7a8-f7208c412670","authorization":""},"operationName":"PROCESSSIMPLE:PATCH/PROVIDERS/MICROSOFT.PROCESSSIMPLE/ENVIRONMENTS/FLOWS/","params":{"api-version":"1","$expand":"properties.connectionreferences.apidefinition,properties.definitionsummary.operations.apioperation,operationDefinition,plan,properties.throttleData,properties.estimatedsuspensiondata,properties.licenseData,properties.billingContext,properties.throttlingBehavior,properties.powerFlowType,properties.protectionStatus","telemetryMetadata":"{\"modifiedSources\":\"Portal\"}"},"method":"patch","url":"https://02094c855e0be56683be539567634c.15.environment.api.powerplatform.com/powerautomate/flows/323ba253-2622-4ec3-a16b-ac0bbd8c0de5","data":"{\"properties\":{\"connectionReferences\":{\"shared_sharepointonline\":{\"id\":\"/providers/Microsoft.PowerApps/apis/shared_sharepointonline\",\"connectionName\":\"shared-sharepointonl-61f4add4-143b-4ec0-9e3a-49124128ae48\",\"source\":\"Embedded\"},\"shared_teams\":{\"id\":\"/providers/Microsoft.PowerApps/apis/shared_teams\",\"connectionName\":\"shared-teams-c48db00a-b23a-478b-9257-25ab378ee258\"}},\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"contentVersion\":\"1.0.0.0\",\"parameters\":{\"$authentication\":{\"defaultValue\":{},\"type\":\"SecureObject\"},\"$connections\":{\"defaultValue\":{},\"type\":\"Object\"}},\"triggers\":{\"Recurrence\":{\"type\":\"Recurrence\",\"recurrence\":{\"interval\":1,\"frequency\":\"Week\",\"timeZone\":\"Central Standard Time\",\"schedule\":{\"weekDays\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\"],\"hours\":[\"9\"]}}}},\"actions\":{\"Get_items\":{\"type\":\"OpenApiConnection\",\"inputs\":{\"parameters\":{\"dataset\":\"https://cagrecipe.sharepoint.com/sites/ConagraCB\",\"table\":\"60df70af-33c6-48b7-a664-928ab144eb05\"},\"host\":{\"apiId\":\"/providers/Microsoft.PowerApps/apis/shared_sharepointonline\",\"operationId\":\"GetItems\",\"connectionName\":\"shared_sharepointonline\"}},\"runAfter\":{}},\"For_each\":{\"type\":\"Foreach\",\"foreach\":\"@outputs('Get_items')?['body/value']\",\"actions\":{\"Condition\":{\"type\":\"If\",\"expression\":{\"and\":[{\"equals\":[\"@items('For_each')?['Status/Value']\",\"In Supply\"]}]},\"actions\":{\"Post_message_in_a_chat_or_channel\":{\"type\":\"OpenApiConnection\",\"inputs\":{\"parameters\":{\"poster\":\"Flow bot\",\"location\":\"Chat with Flow bot\",\"body/recipient\":\"@items('For_each_1')?['Email']\",\"body/messageBody\":\"<p class=\\\"editor-paragraph\\\">Test 4</p>\"},\"host\":{\"apiId\":\"/providers/Microsoft.PowerApps/apis/shared_teams\",\"operationId\":\"PostMessageToConversation\",\"connectionName\":\"shared_teams\"}}}},\"else\":{\"actions\":{}}}},\"runAfter\":{\"Get_items\":[\"Succeeded\"]}}},\"outputs\":{}},\"displayName\":\"Order in Supply Reminder\",\"environment\":{\"name\":\"02094c85-5e0b-e566-83be-539567634c15\"}},\"name\":\"323ba253-2622-4ec3-a16b-ac0bbd8c0de5\",\"telemetryMetadata\":{\"modifiedSources\":\"Portal\"}}","team":"PowerAutomate","bodyDetails":{"locale":"en-US"},"axios-retry":{"retryCount":0,"lastRequestTime":1764010730048},"context":{"ppapiContext":{"endpoint":"02094c855e0be56683be539567634c.15.environment.api.powerplatform.com"}},"knownServiceId":"ppapi-pauto","activityId":"a3105141-81d9-4a54-9acd-df66408ed235"},"request":{}},"isAxiosError":true}
 
I have the same question (0)
  • Ellis Karim Profile Picture
    11,506 Super User 2025 Season 2 on at
    Error while trying to run flow
    AI assisted reply based on your response:

    Code: InvalidOpenApiFlow

    Message:

    Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'For_each_1' referenced by 'inputs' in action 'Post_message_in_a_chat_or_channel' are not defined in the template.'.'

    Plain English: your Post message in a chat or channel action is trying to use items from a loop called For_each_1, but that loop doesn’t exist in the current flow definition (you only have For_each).

     
     
     
     
    Ellis Karim
    Ellis Karim
    elliskarim.com  |  LinkedIn  |  Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!

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

Coming soon: forum hierarchy changes

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

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 494 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 464 Moderator

#3
Expiscornovus Profile Picture

Expiscornovus 279 Most Valuable Professional

Last 30 days Overall leaderboard