Skip to content

Instantly share code, notes, and snippets.

@mxgrey
Last active August 21, 2026 10:36
Show Gist options
  • Select an option

  • Save mxgrey/5fa336894cbf603933c197e8b2cb0739 to your computer and use it in GitHub Desktop.

Select an option

Save mxgrey/5fa336894cbf603933c197e8b2cb0739 to your computer and use it in GitHub Desktop.
node-activity-test.json
{
"$schema": "https://raw.githubusercontent.com/open-rmf/crossflow/refs/heads/main/diagram.schema.json",
"version": "0.1.0",
"templates": {},
"start": "slow_stream",
"ops": {
"slow_stream": {
"type": "script",
"environment": "env",
"run": "slow_stream",
"next": {
"builtin": "dispose"
},
"stream_out": {
"even": "even_buffer",
"odd": "odd_buffer"
}
},
"even_buffer": {
"type": "buffer"
},
"odd_buffer": {
"type": "buffer"
},
"join": {
"type": "join",
"buffers": [
"even_buffer",
"odd_buffer"
],
"next": "add"
},
"add": {
"type": "node",
"builder": "add",
"next": "big_enough"
},
"big_enough": {
"type": "script",
"environment": "env",
"run": "big_enough",
"next": {
"builtin": "dispose"
},
"stream_out": {
"big_enough": {
"builtin": "terminate"
}
}
}
},
"description": "A workflow for testing issues with node activity tracing.\n\nThe slow_stream node will fire off even or odd values out of different streams which each lead to a buffer.\n\nThe join operation will bring together the values that land in the buffers. These values will be added and then checked for size. If the size is bigger than 10, then the workflow will terminate.\n\nYou should see the left and right buffers flash in an alternating pattern. There should be 1 second between each left/right flash. With each right flash, all the nodes and edges from Join down should flash.",
"input_examples": [
{
"description": "Prints out the fibonacci sequence of 10",
"value": "10"
},
{
"description": "Prints out the fibonacci sequence of 20",
"value": "20"
}
],
"script_environments": {
"env": {
"builder": "process-bound-python",
"config": {
"ownership": "shared",
"script": "import asyncio\nfrom crossflow import *\n\nasync def slow_stream(input: Input):\n for i in range(0, input.data):\n await asyncio.sleep(1)\n if i % 2 == 0:\n input.stream_out('even', i)\n else:\n input.stream_out('odd', i)\n\ndef big_enough(input: Input):\n if input.data > 10:\n input.stream_out('big_enough', input.data)"
}
}
},
"extensions": {
"crossflow-diagram-editor-v1": {
"hash": "915f34958c1ae32231ee95102c4fe4c851f1ce3b",
"state": {
"nodes": [
{
"id": ":__builtin_start__",
"type": "start",
"position": {
"x": 225,
"y": 25
},
"selectable": false,
"data": {
"namespace": ""
},
"measured": {
"width": 200,
"height": 50
},
"selected": false,
"dragging": false
},
{
"id": ":__builtin_terminate__",
"type": "terminate",
"position": {
"x": 225,
"y": 625
},
"selectable": false,
"data": {
"namespace": ""
},
"measured": {
"width": 200,
"height": 50
},
"selected": false,
"dragging": false
},
{
"id": "f5c8571d-b5b7-47cd-be58-22f893ef6e69",
"type": "script",
"position": {
"x": 225,
"y": 125
},
"data": {
"namespace": "",
"opId": "slow_stream",
"op": {
"type": "script",
"environment": "env",
"run": "slow_stream",
"next": {
"builtin": "dispose"
},
"stream_out": {
"even": "even_buffer",
"odd": "odd_buffer"
}
}
},
"measured": {
"width": 200,
"height": 50
},
"selected": false,
"dragging": false
},
{
"id": "cd008867-92c3-466d-b750-5ad4a05adeff",
"type": "buffer",
"position": {
"x": 100,
"y": 225
},
"data": {
"namespace": "",
"opId": "even_buffer",
"op": {
"type": "buffer"
}
},
"measured": {
"width": 200,
"height": 50
},
"selected": false
},
{
"id": "e924419e-8d17-472a-a58f-b800222095c8",
"type": "buffer",
"position": {
"x": 350,
"y": 225
},
"data": {
"namespace": "",
"opId": "odd_buffer",
"op": {
"type": "buffer"
}
},
"measured": {
"width": 200,
"height": 50
},
"selected": false,
"dragging": false
},
{
"id": "9647b135-200e-4aca-9182-2a195c367330",
"type": "join",
"position": {
"x": 225,
"y": 325
},
"data": {
"namespace": "",
"opId": "join",
"op": {
"type": "join",
"buffers": [
"even_buffer",
"odd_buffer"
],
"next": "add"
}
},
"measured": {
"width": 42,
"height": 42
},
"selected": false,
"dragging": false
},
{
"id": "2d43633d-ab6d-4f04-8dd2-fb39cc42e184",
"type": "node",
"position": {
"x": 225,
"y": 425
},
"data": {
"namespace": "",
"opId": "add",
"op": {
"type": "node",
"builder": "add",
"next": "big_enough"
}
},
"measured": {
"width": 200,
"height": 50
},
"selected": false,
"dragging": false
},
{
"id": "e2085078-a560-4399-8f52-42c15a9c2107",
"type": "script",
"position": {
"x": 225,
"y": 525
},
"data": {
"namespace": "",
"opId": "big_enough",
"op": {
"type": "script",
"environment": "env",
"run": "big_enough",
"next": {
"builtin": "dispose"
},
"stream_out": {
"big_enough": {
"builtin": "terminate"
}
}
}
},
"measured": {
"width": 200,
"height": 50
},
"selected": false,
"dragging": false
}
],
"edges": [
{
"id": "5b6148a4-2f28-4dce-8ff1-5450042c57bd",
"source": "f5c8571d-b5b7-47cd-be58-22f893ef6e69",
"sourceHandle": "dataStream",
"target": "cd008867-92c3-466d-b750-5ad4a05adeff",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "streamOut",
"data": {
"output": {
"streamId": "even"
},
"input": {
"type": "default"
}
},
"selected": false
},
{
"id": "ff88aa44-db6f-424e-ab23-7903caeeee73",
"source": "f5c8571d-b5b7-47cd-be58-22f893ef6e69",
"sourceHandle": "dataStream",
"target": "e924419e-8d17-472a-a58f-b800222095c8",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "streamOut",
"data": {
"output": {
"streamId": "odd"
},
"input": {
"type": "default"
}
},
"selected": false
},
{
"id": "d7a03026-3819-4b92-978c-06e15a126939",
"source": "cd008867-92c3-466d-b750-5ad4a05adeff",
"target": "9647b135-200e-4aca-9182-2a195c367330",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "buffer",
"data": {
"output": {},
"input": {
"type": "bufferSeq",
"seq": 0
}
},
"style": {},
"selected": false
},
{
"id": "c70e0945-e639-49a2-beb0-78b21b1b6698",
"source": "e924419e-8d17-472a-a58f-b800222095c8",
"target": "9647b135-200e-4aca-9182-2a195c367330",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "buffer",
"data": {
"output": {},
"input": {
"type": "bufferSeq",
"seq": 1
}
},
"style": {},
"selected": false
},
{
"id": "7bed2a40-989a-49bc-bc93-c7eca5c35d95",
"source": "9647b135-200e-4aca-9182-2a195c367330",
"target": "2d43633d-ab6d-4f04-8dd2-fb39cc42e184",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "default",
"data": {
"output": {},
"input": {
"type": "default"
}
},
"selected": false
},
{
"id": "0c790f7e-9f93-4c30-9f92-6d59c6b8273f",
"source": "2d43633d-ab6d-4f04-8dd2-fb39cc42e184",
"target": "e2085078-a560-4399-8f52-42c15a9c2107",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "default",
"data": {
"output": {},
"input": {
"type": "default"
}
},
"selected": false
},
{
"id": "2b8c3bc0-fc05-4133-8bbe-454fa6e8656a",
"source": "e2085078-a560-4399-8f52-42c15a9c2107",
"sourceHandle": "dataStream",
"target": ":__builtin_terminate__",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "streamOut",
"data": {
"output": {
"streamId": "big_enough"
},
"input": {
"type": "default"
}
},
"selected": false
},
{
"id": "efc766d1-2ad4-4d08-809b-47a98b2d7734",
"source": ":__builtin_start__",
"target": "f5c8571d-b5b7-47cd-be58-22f893ef6e69",
"markerEnd": {
"type": "arrowclosed",
"width": 20,
"height": 20
},
"type": "default",
"data": {
"output": {},
"input": {
"type": "default"
}
},
"selected": false
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment