You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

消费版Logic App中HTTP POST重复执行问题(已禁用重试策略)

消费版Logic App重复调用外部API问题

工作流概述

我有一个消费版Logic App,用于处理工时表并将结果批量发送至外部API端点(POST https://payhero-public.azure-api.net/time)。工作流简化流程如下:

  • 收到HTTP请求时触发
  • 初始化数组变量TimesheetOutput
  • 遍历HF工时表:
    • 嵌套遍历PayTypes
    • 获取Azure Tables中的WorkKey实体
    • 组合PayType信息
    • 将结果追加至TimesheetOutput数组
  • 通过HTTP POST动作发送完整的TimesheetOutput至外部API

预期行为

外部API应在每次运行中仅被调用一次,且在所有工时表条目处理完成后执行。

实际行为

单次Logic App运行中,外部API被调用两次,负载完全相同:

  • 第一次调用:2025-09-15T21:01:12.0710928Z 开始,约2025-09-15T21:04:22.795Z 结束
  • 第二次调用:2025-09-15T21:05:44.2535052Z 开始,约2025-09-15T21:07:44.244Z 结束

但运行历史仅显示一次运行,门户中仅能看到一次HTTP动作(起止时间与第二次调用一致)。该HTTP动作已配置retryPolicy: none,无手动重提交或重复触发情况。

运行时间线

  • When_a_HTTP_request_is_received:2025-09-15T21:00:02Z 开始,2025-09-15T21:07:44Z 结束
  • Initialize_variable_-_TimesheetOutput:2025-09-15T21:00:02Z
  • For_each_-_HF_Timesheet:2025-09-15T21:00:02Z → 21:01:12Z(与第一次调用开始时间一致)
  • HTTP_-_POST_PH_Time(门户可见):2025-09-15T21:05:44Z 开始 → 2025-09-15T21:07:44Z 结束

关联观察

第一次调用时间与遍历完成TimesheetOutput的时间一致;第二次调用时间与门户可见的HTTP动作开始时间一致。

简化后的Logic App定义

{
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "triggers": {
      "When_a_HTTP_request_is_received": { "type": "Request", "kind": "Http" }
    },
    "actions": {
      "Initialize_variable_-_TimesheetOutput": {
        "type": "InitializeVariable",
        "inputs": {
          "variables": [{ "name": "TimesheetOutput", "type": "Array", "value": [] }]
        }
      },
      "For_each_-_HF_Timesheet": {
        "type": "Foreach",
        "foreach": "@triggerBody()",
        "runtimeConfiguration": {
          "concurrency": { "repetitions": 50 }
        },
        "actions": {
          "For_each_-_PayTypes": {
            "type": "Foreach",
            "foreach": "@items('For_each_-_HF_Timesheet')?['PayTypes']",
            "runtimeConfiguration": {
              "concurrency": { "repetitions": 1 }
            },
            "actions": {
              "Get_entity_-_WorkKey": { "type": "ApiConnection", "inputs": {} },
              "Compose_-_PayType": { "type": "Compose", "inputs": {} },
              "Append_to_array_variable_-_TimesheetOutput": {
                "type": "AppendToArrayVariable",
                "inputs": { "name": "TimesheetOutput", "value": "@outputs('Compose_-_PayType')" }
              }
            }
          }
        }
      },
      "HTTP_-_POST_PH_Time": {
        "type": "Http",
        "inputs": {
          "method": "POST",
          "uri": "@parameters('PHTimeURL')",
          "body": { "times": "@variables('TimesheetOutput')" },
          "retryPolicy": { "type": "none" }
        },
        "runAfter": {
          "For_each_-_HF_Timesheet": [ "Succeeded", "TimedOut", "Skipped", "Failed" ]
        },
        "runtimeConfiguration": {
          "contentTransfer": {
            "transferMode": "Chunked"
          }
        }
      }
    }
  }
}

问题

为何单次Logic App运行会导致同一个HTTP动作重复调用外部API两次?已禁用重试策略且运行历史仅显示一次运行,这是Logic Apps运行时已知bug还是工作流配置错误?


内容的提问来源于stack exchange,提问作者Vishal Makwana

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 08:13:10