Skip to content

Instantly share code, notes, and snippets.

@redaphid
Created November 12, 2014 18:10
Show Gist options
  • Save redaphid/a47d6c0202f9a2159949 to your computer and use it in GitHub Desktop.
Save redaphid/a47d6c0202f9a2159949 to your computer and use it in GitHub Desktop.
Flow-to-flow communication
{
"flowId": "dd4e0f21-5000-11e4-baa6-6f19a6abebaa",
"token": "0yr22bcs1iuul3dibn6zyntyw48wipb9",
"hash": "c86083c3",
"name": "Cat-Facts",
"nodes": [
{
"id": "e2613140-5000-11e4-adbf-91df5d5432ef",
"resourceType": "flow-node",
"output": 1,
"func": "\nreturn [ \"Every year, nearly four million cats are eaten in Asia.\",\n \"On average, cats spend 2/3 of every day sleeping. That means a nine-year-old cat has been awake for only three years of its life.\",\n \"Unlike dogs, cats do not have a sweet tooth. Scientists believe this is due to a mutation in a key taste receptor.\",\n \"When a cat chases its prey, it keeps its head level. Dogs and humans bob their heads up and down.\",\n \"The technical term for a cat’s hairball is a “bezoar.”\",\n \"A group of cats is called a “clowder.”\",\n \"Female cats tend to be right pawed, while male cats are more often left pawed. Interestingly, while 90% of humans are right handed, the remaining 10% of lefties also tend to be male.\",\n \"A cat cannot climb head first down a tree because its claws are curved the wrong way\",\n \"A cat can’t climb head first down a tree because every claw on a cat’s paw points the same way. To get down from a tree, a cat must back down.\",\n \"Cats make about 100 different sounds. Dogs make only about 10.\",\n \"A cat’s brain is biologically more similar to a human brain than it is to a dog’s. Both humans and cats have identical regions in their brains that are responsible for emotions.\",\n \"There are more than 500 million domestic cats in the world, with approximately 40 recognized breeds.\",\n \"Approximately 24 cat skins can make a coat.\",\n \"While it is commonly thought that the ancient Egyptians were the first to domesticate cats, the oldest known pet cat was recently found in a 9,500-year-old grave on the Mediterranean island of Cyprus. This grave predates early Egyptian art depicting cats by 4,000 years or more.\",\n \"During the time of the Spanish Inquisition, Pope Innocent VIII condemned cats as evil and thousands of cats were burned. Unfortunately, the widespread killing of cats led to an explosion of the rat population, which exacerbated the effects of the Black Death.\",\n \"During the Middle Ages, cats were associated with withcraft, and on St. John’s Day, people all over Europe would stuff them into sacks and toss the cats into bonfires. On holy days, people celebrated by tossing cats from church towers.\",\n \"Cats are North America’s most popular pets: there are 73 million cats compared to 63 million dogs. Over 30% of households in North America own a cat.\",\n \"The first cat in space was a French cat named Felicette (a.k.a. “Astrocat”) In 1963, France blasted the cat into outer space. Electrodes implanted in her brains sent neurological signals back to Earth. She survived the trip.\",\n \"The group of words associated with cat stem from the Latin catus, meaning domestic cat, as opposed to feles, or wild cat.\",\n \"The term “puss” is the root of the principal word for “cat” in the Romanian term pisica and the root of secondary words in Lithuanian (puz) and Low German puus. Some scholars suggest that “puss” could be imitative of the hissing sound used to get a cat’s attention. As a slang word for the female pudenda, it could be associated with the connotation of a cat being soft, warm, and fuzzy.<sup>j</sup>\",\n \"Approximately 40,000 people are bitten by cats in the U.S. annually.\",\n \"According to Hebrew legend, Noah prayed to God for help protecting all the food he stored on the ark from being eaten by rats. In reply, God made the lion sneeze, and out popped a cat.\",\n \"A cat’s hearing is better than a dog’s. And a cat can hear high-frequency sounds up to two octaves higher than a human.\",\n \"A cat can travel at a top speed of approximately 31 mph (49 km) over a short distance.\",\n \"A cat can jump up to five times its own height in a single bound.\",\n \"Some cats have survived falls of over 65 feet (20 meters), due largely to their “righting reflex.” The eyes and balance organs in the inner ear tell it where it is in space so the cat can land on its feet. Even cats without a tail have this ability.\",\n ];",
"name": "facts",
"class": "function",
"category": "operation",
"uuid": "37f0a3a8-2f17-11e4-9617-a6c5e4d22fb7",
"type": "operation:function",
"defaults": {
"output": 1,
"func": "\nreturn msg;"
},
"input": 1,
"formTemplatePath": "/pages/node_forms/function_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/function.svg",
"inputLocations": [
30
],
"outputLocations": [
30
],
"x": 1011.3382568359375,
"y": -302.0661315917969
},
{
"id": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"resourceType": "flow-node",
"output": 1,
"func": "\nreturn {fact: _.sample(msg)};",
"name": "sample",
"class": "function",
"category": "operation",
"uuid": "37f0a3a8-2f17-11e4-9617-a6c5e4d22fb7",
"type": "operation:function",
"defaults": {
"output": 1,
"func": "\nreturn msg;"
},
"input": 1,
"formTemplatePath": "/pages/node_forms/function_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/function.svg",
"inputLocations": [
30
],
"outputLocations": [
30
],
"x": 1147.3382568359375,
"y": -301.3994445800781
},
{
"id": "63b05b40-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"payloadType": "date",
"once": false,
"name": "Request-Fact",
"class": "trigger",
"category": "operation",
"uuid": "37f0a74a-2f17-11e4-9617-a6c5e4d22fb7",
"type": "operation:trigger",
"defaults": {
"payloadType": "date",
"once": false
},
"input": 0,
"output": 1,
"formTemplatePath": "/pages/node_forms/button_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/trigger.svg",
"inputLocations": [],
"outputLocations": [
30
],
"x": 743.3381958007812,
"y": -301.3994445800781
},
{
"id": "6cecdbc0-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"interval": 1000,
"name": "throttle",
"class": "throttle",
"type": "operation:throttle",
"category": "operation",
"uuid": "794922ff-3792-4e4e-a0e2-a0823ed6b82e",
"defaults": {
"interval": 1000
},
"input": 1,
"output": 1,
"formTemplatePath": "/pages/node_forms/throttle_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/throttle.svg",
"inputLocations": [
30
],
"outputLocations": [
30
],
"x": 875.3381958007812,
"y": -301.3994445800781
},
{
"id": "7fc2a2c0-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"uuid": "*",
"topic": "message",
"name": "Output",
"class": "output",
"category": "operation",
"type": "operation:output",
"defaults": {
"uuid": "*",
"topic": "message"
},
"input": 1,
"formTemplatePath": "/pages/node_forms/output_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/output.svg",
"inputLocations": [
30
],
"outputLocations": [],
"x": 1281.3382568359375,
"y": -300.7327880859375
}
],
"links": [
{
"from": "10567b50-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "e2613140-5000-11e4-adbf-91df5d5432ef",
"toPort": 0
},
{
"from": "e2613140-5000-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"toPort": 0
},
{
"from": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "1caf5700-5001-11e4-adbf-91df5d5432ef",
"toPort": 0
},
{
"from": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "7b37c780-5001-11e4-87dd-23482e3b519f",
"toPort": 0
},
{
"from": "0b19fc40-5c57-11e4-953c-fbb22b0f8cbf",
"fromPort": 0,
"to": "7b37c780-5001-11e4-87dd-23482e3b519f",
"toPort": 0
},
{
"from": "2c2ca130-5c57-11e4-953c-fbb22b0f8cbf",
"fromPort": 0,
"to": "0b19fc40-5c57-11e4-953c-fbb22b0f8cbf",
"toPort": 0
},
{
"from": "b8717470-5001-11e4-87dd-23482e3b519f",
"fromPort": 0,
"to": "0b19fc40-5c57-11e4-953c-fbb22b0f8cbf",
"toPort": 0
},
{
"from": "b8717470-5001-11e4-87dd-23482e3b519f",
"fromPort": 0,
"to": "e2613140-5000-11e4-adbf-91df5d5432ef",
"toPort": 0
},
{
"from": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "fcf1edf0-5f0b-11e4-96b5-73bf5dc29094",
"toPort": 0
},
{
"from": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "c1944010-6194-11e4-8852-f9d05eaafb6e",
"toPort": 0
},
{
"from": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "d00d0770-63b6-11e4-ac63-bf1b47d20486",
"toPort": 0
},
{
"from": "d00d0770-63b6-11e4-ac63-bf1b47d20486",
"fromPort": 0,
"to": "1caf5700-5001-11e4-adbf-91df5d5432ef",
"toPort": 0
},
{
"from": "6cecdbc0-66ea-11e4-9772-f585a536000e",
"fromPort": 0,
"to": "e2613140-5000-11e4-adbf-91df5d5432ef",
"toPort": 0
},
{
"from": "63b05b40-66ea-11e4-9772-f585a536000e",
"fromPort": 0,
"to": "6cecdbc0-66ea-11e4-9772-f585a536000e",
"toPort": 0
},
{
"from": "03e5aad0-5001-11e4-adbf-91df5d5432ef",
"fromPort": 0,
"to": "7fc2a2c0-66ea-11e4-9772-f585a536000e",
"toPort": 0
}
],
"zoomScale": 1.5,
"zoomX": -1034.0073852539062,
"zoomY": 693.5991720557213,
"online": true
}
{
"flowId": "8d6bf341-66ea-11e4-9417-b1ef2bfe6918",
"token": "saydgozpsc9s5rk9uq5gsatujupaatt9",
"hash": "21e13413",
"name": "Fact-Consumer",
"nodes": [
{
"id": "a1c76fe0-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"name": "Cat-Facts",
"uuid": "dd4e0f21-5000-11e4-baa6-6f19a6abebaa",
"category": "device",
"type": "device:flow",
"staticMessage": {
"from": "63b05b40-66ea-11e4-9772-f585a536000e"
},
"topic": "button",
"filterTopic": "message",
"useStaticMessage": true,
"nodeType": {},
"class": "Cat-Facts",
"defaults": {
"name": "Cat-Facts",
"uuid": "dd4e0f21-5000-11e4-baa6-6f19a6abebaa",
"category": "device",
"type": "device:flow",
"staticMessage": {},
"topic": "button",
"filterTopic": "message",
"useStaticMessage": true,
"nodeType": {}
},
"input": 1,
"output": 1,
"formTemplatePath": "/pages/node_forms/device_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/device/flow.svg",
"inputLocations": [
30
],
"outputLocations": [
30
],
"x": 767,
"y": 239
},
{
"id": "ab126f50-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"active": true,
"debug": true,
"complete": false,
"name": "debug",
"class": "debug",
"category": "operation",
"uuid": "37f0b88e-2f17-11e4-9617-a6c5e4d22fb7",
"type": "operation:debug",
"defaults": {
"active": true,
"debug": true,
"complete": false
},
"color": "#87a980",
"input": 1,
"output": 0,
"align": "right",
"formTemplatePath": "/pages/node_forms/debug_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/debug.svg",
"inputLocations": [
30
],
"outputLocations": [],
"x": 973.4696044921875,
"y": 221.44097900390625
},
{
"id": "b0978d20-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"payloadType": "date",
"once": false,
"name": "trigger",
"class": "trigger",
"category": "operation",
"uuid": "37f0a74a-2f17-11e4-9617-a6c5e4d22fb7",
"type": "operation:trigger",
"defaults": {
"payloadType": "date",
"once": false
},
"input": 0,
"output": 1,
"formTemplatePath": "/pages/node_forms/button_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/trigger.svg",
"inputLocations": [],
"outputLocations": [
30
],
"x": 573.743408203125,
"y": 236.98110961914062
}
],
"links": [
{
"from": "a1c76fe0-66ea-11e4-9772-f585a536000e",
"fromPort": 0,
"to": "ab126f50-66ea-11e4-9772-f585a536000e",
"toPort": 0
},
{
"from": "b0978d20-66ea-11e4-9772-f585a536000e",
"fromPort": 0,
"to": "a1c76fe0-66ea-11e4-9772-f585a536000e",
"toPort": 0
}
],
"zoomScale": 1.1582928061946434,
"zoomX": -34.894530818318344,
"zoomY": -91.0337440457084,
"online": true,
"selectedLink": null,
"selectedFlowNode": {
"id": "ab126f50-66ea-11e4-9772-f585a536000e",
"resourceType": "flow-node",
"active": true,
"debug": true,
"complete": false,
"name": "debug",
"class": "debug",
"category": "operation",
"uuid": "37f0b88e-2f17-11e4-9617-a6c5e4d22fb7",
"type": "operation:debug",
"defaults": {
"active": true,
"debug": true,
"complete": false
},
"color": "#87a980",
"input": 1,
"output": 0,
"align": "right",
"formTemplatePath": "/pages/node_forms/debug_form.html",
"logo": "https://ds78apnml6was.cloudfront.net/operation/debug.svg",
"inputLocations": [
30
],
"outputLocations": [],
"x": 973.4696044921875,
"y": 221.44097900390625
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment