Condition

Any time the Dataset changes, the conditions will be evaluated. When a condition is successfully met, a new Task will be enqueued. Due to the immutable, content-addressable nature of IPFS, if a condition is successfully evaluated multiple times across multiple nodes, the resulting action is idempotent.

The conditions syntax is based on govaluate with some custom functions for accessing Hash Pointer Collaboration Protocol and a Grow Only Hash Object.

Example Condition

{
  "action": "map",
  "condition": "exist(dataset(hpcp('zdpuAxC1mnb6USNY8psFA2fowsDrngsFNefMx42TX9ZDjLvVr/split/results'))) && !exist(dataset(hpcp('zdpuAxC1mnb6USNY8psFA2fowsDrngsFNefMx42TX9ZDjLvVr/map/results')))",
  "name": "Create Map tasks",
  "source": {
    "dataset": {
      "/": "zdpuAxC1mnb6USNY8psFA2fowsDrngsFNefMx42TX9ZDjLvVr"
    },
    "path": "split/results"
  },
  "taskDefinition": {
    "/": "zdpuAvKf8Bjgpjdd1BwdBMWrtGLn1PhmCkCoSXKUAv2NmxgYL"
  }
}

Action

map will allow each member of the source data to be used as the input for a new task. If action is missing, the source data will be passed to the new task as one data point.