Metadata


Every object on our platform is capable of storing metadata. Metadata can be anything, we place no restrictions on you using it. And, it isn't typed by our platform, so you can place anything you want in there.

Generally, we add it to an object when we want to store data about that object itself. For example, our Track Builder GUI, to store the location, type and contents of every node in the GUI.

You store metadata in any platform object by adding an object, metadata, to the root of the json object.

Examples

Drop

 {
      "path": "/my_account_id/my_first_flow",
      "metadata": {
        "meta": "data"
      },
      "elems": {
          "name": "foo"
      }
  }

Track

  {
    "source" : "/my_account_id/my_first_flow",
    "metadata": {
      "meta": "data"
    },
    "destination" : ["/my_account_id/my_second_flow"],
    "js" : "function f(input) {
                     var output = input;
                     return {
                       '/my_account_id/my_second_flow': [output]
                     }
                 }"
  }

Flow

  {
    "path": "/my_account_id/drink_recipes",
    "description": "My Drink Recipies",
    "filter": "EXISTS title"
  }

Uses

Other than in the Track GUI, there's one other usage that's of particular interest. It is used in an MQTT task to broadcast data from that MQTT task on a dynamic topic.

So, for example, in a track, an MQTT topic can be set in the metadata:

  "metadata": {
    "mqttTopic": "/my/new/mqtt/topic"
  }

This metadata topic will override the base topic on the MQTT task, allowing topics to become dynamic.