{
  "Comment": "Find a cat.",
  "StartAt": "FindingRupert",
  "version": "1.0",
  "States": {
    "FindingRupert": {
      "Type": "Task",
      "Resource": "module:finding",
      "ResourceConfig": {
        "modelId": "cat",
        "filter": {
          "where": {
            "name": {
              "equals": "Rupert"
            }
          }
        }
      },
      "ResultPath": "$.catDocFromStorage",
      "Next": "CountingRupert"
    },
    "CountingRupert": {
      "Type": "Task",
      "Resource": "module:findingCount",
      "ResourceConfig": {
        "modelId": "cat",
        "filter": {
          "where": {
            "name": {
              "equals": "Rupert"
            }
          }
        }
      },
      "ResultPath": "$.countCatDocFromStorage",
      "Next": "FindingWilfred"
    },
    "FindingWilfred": {
      "Type": "Task",
      "Resource": "module:finding",
      "ResourceConfig": {
        "modelId": "cat",
        "filter": {
          "where": {
            "name": {
              "equals": "$.catName"
            }
          }
        }
      },
      "ResultPath": "$.anotherCatDocFromStorage",
      "End": true
    }
  },
  "restrictions": [
    {
      "roleId": "$authenticated",
      "allows": [
        "*"
      ]
    }
  ]
}
