{
  "format": "chatigram-workflow",
  "version": 1,
  "metadata": {
    "sourceName": "Return an order status from your business API",
    "importHelp": {
      "note": "Setup required. Set the endpoint secret, order-system API URL, authorization, expected order identifier, and response extraction path. Add the access checks your use case requires. Placeholder endpoints use example.invalid and cannot call a real business service. Keep the workflow disabled until you finish the setup and review its effects."
    }
  },
  "workflow": {
    "instruction": null,
    "multiLanguageSupport": null,
    "properties": [],
    "trigger": {
      "$tag": "Trigger",
      "type": "HTTP_ENDPOINT",
      "data": {
        "secretKey": "",
        "authEnabled": true,
        "extractors": [
          {
            "$tag": "GetJsonValueAsString",
            "variableName": "orderId",
            "jsonPath": "$.orderId"
          }
        ]
      }
    },
    "nodes": [
      {
        "$tag": "Node",
        "id": "d0c00000-0000-4000-8000-000000000001",
        "name": "orderLookup",
        "parentId": null,
        "branchIndex": 0,
        "type": "HTTP_REQUEST_NODE_TYPE",
        "data": {
          "request": {
            "method": "GET",
            "path": [
              {
                "$tag": "Constant",
                "value": "https://business-api.example.invalid/orders/status"
              }
            ],
            "headers": [
              {
                "key": "Content-Type",
                "value": [
                  {
                    "$tag": "Constant",
                    "value": "application/json"
                  }
                ]
              }
            ],
            "queryStrings": [
              {
                "key": "orderId",
                "value": [
                  {
                    "$tag": "Variable",
                    "name": "trigger.orderId"
                  }
                ]
              }
            ],
            "body": [
              {
                "$tag": "Constant",
                "value": ""
              }
            ]
          },
          "responseHandlers": [
            {
              "$tag": "GetJsonValueAsString",
              "variableName": "status",
              "jsonPath": "$.status"
            }
          ]
        }
      },
      {
        "$tag": "Node",
        "id": "d0c00000-0000-4000-8000-000000000002",
        "name": "orderReply",
        "parentId": "d0c00000-0000-4000-8000-000000000001",
        "branchIndex": 0,
        "type": "HTTP_RESPONSE",
        "data": {
          "statusCode": 200,
          "headers": [],
          "body": {
            "$tag": "Json",
            "value": {
              "$tag": "Object",
              "properties": [
                {
                  "key": "status",
                  "value": {
                    "$tag": "String",
                    "value": [
                      {
                        "$tag": "Variable",
                        "name": "orderLookup.status"
                      }
                    ]
                  }
                }
              ]
            }
          }
        }
      },
      {
        "$tag": "Node",
        "id": "d0c00000-0000-4000-8000-000000000003",
        "name": "orderFailure",
        "parentId": "d0c00000-0000-4000-8000-000000000001",
        "branchIndex": 1,
        "type": "HTTP_RESPONSE",
        "data": {
          "statusCode": 502,
          "headers": [],
          "body": {
            "$tag": "Json",
            "value": {
              "$tag": "Object",
              "properties": [
                {
                  "key": "status",
                  "value": {
                    "$tag": "String",
                    "value": [
                      {
                        "$tag": "Constant",
                        "value": "lookup_unavailable"
                      }
                    ]
                  }
                }
              ]
            }
          }
        }
      }
    ],
    "gotos": []
  }
}
