{"id":26445597,"url":"https://github.com/cisco-open/stated-workflow","last_synced_at":"2025-06-17T14:37:43.095Z","repository":{"id":220237992,"uuid":"704707946","full_name":"cisco-open/stated-workflow","owner":"cisco-open","description":"Stated Workflow  is a collection of functions for a lightweight and scalable event-driven workflow engine using Stated template engine","archived":false,"fork":false,"pushed_at":"2024-05-22T23:56:30.000Z","size":726,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-23T00:13:43.072Z","etag":null,"topics":["config","json","jsonata","state","state-management","state-store","workflow","yaml"],"latest_commit_sha":null,"homepage":"https://github.com/cisco-open/stated-workflow","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cisco-open.png","metadata":{"files":{"readme":"README.API.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-13T21:55:44.000Z","updated_at":"2024-05-29T03:35:53.263Z","dependencies_parsed_at":"2024-04-10T16:35:17.008Z","dependency_job_id":"25bf5e9b-8785-4688-9dfb-20c1d1f31930","html_url":"https://github.com/cisco-open/stated-workflow","commit_stats":null,"previous_names":["cisco-open/stated-workflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-open%2Fstated-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-open%2Fstated-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-open%2Fstated-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-open%2Fstated-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cisco-open","download_url":"https://codeload.github.com/cisco-open/stated-workflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244208595,"owners_count":20416110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","json","jsonata","state","state-management","state-store","workflow","yaml"],"created_at":"2025-03-18T11:19:37.871Z","updated_at":"2025-03-18T11:19:38.534Z","avatar_url":"https://github.com/cisco-open.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- TOC --\u003e\n* [Workflow Management API](#workflow-management-api)\n  * [/workflow APIs](#workflow-apis)\n  * [/restore APIs](#restore-apis)\n* [Getting Started](#getting-started)\n  * [Run locally](#run-locally)\n  * [Run in Docker](#run-in-docker)\n* [API Examples](#api-examples)\n\u003c!-- TOC --\u003e\n\n# Workflow Management API\nStated workflow can be run in a containerized environment and provide a REST API to manage the workflow.\n\n## /workflow APIs\nList all running workflows. Start, stop and view workflows. \n\n## /restore APIs\nFetch workflow's latest snapshot and restore the workflow from the snapshot.\n\n## /workflow/{workflowId}/{type}/{subscriber} APIs\nThis API can be used to send an event to the workflow dispatcher. The event will be dispatched to the subscriber of the \ngiven type.\n\n# Getting Started\n## Run locally\n```shell\nnode stated-workflow-api\n```\n## Run in Docker\nBuild image - the below command in docker should work for both amd64 and arm64 platforms\n```shell\nV=0.0.1 \u0026\u0026 docker buildx build --platform linux/amd64 . --tag sesergee773/statedworkflow:$V\n```\nRun it in your docker \n```shell\ndocker run -d -it  -p 8080:8080 sesergee773/statedworkflow:$V\n```\n\n# API Examples\n\n```shell\n# submit a workflow template\nworkflowId=`curl -H 'Content-Type:application/json' http://localhost:8080/workflow -X POST -d @example/joinResistanceRecovery.json | jq -r '.workflowId'`  \u0026\u0026 echo $workflowId || echo failed to start the workflow: $!\n```\n\n```shell\n# list all workflows\ncurl -H 'Content-Type:application/json' http://localhost:8080/workflow | jq\n```\n\n```shell\n# get te workflow output\ncurl -H 'Content-Type:application/json' http://localhost:8080/workflow/$workflowId | jq\n```\n\n```shell\n# stop the workflow \ncurl -H 'Content-Type:application/json' http://localhost:8080/workflow/$workflowId -X DELETE | jq\n```\n\n```shell\n# show the latest workflow snapshot\ncurl -H 'Content-Type:application/json' http://localhost:8080/restore/$workflowId | jq\n```\n\n```shell\n# restore the workflow from the latest snapshot\ncurl -H 'Content-Type:application/json' http://localhost:8080/restore/$workflowId -X POST | jq\n```\n\n```shell\n# send an event with rebel named \"obi\" to the workflow dispatcher for \"rebelDispatch\" type and \"rebelArmy\" subscriber\ncurl -H 'Content-Type: application/json' http://localhost:8080/workflow/${workflowId}/rebelDispatch/rebelArmy -X POST -d '[\"obi\"]'\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-open%2Fstated-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcisco-open%2Fstated-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-open%2Fstated-workflow/lists"}