{"id":15471545,"url":"https://github.com/sammarks/workflow","last_synced_at":"2025-04-22T13:15:19.493Z","repository":{"id":57139278,"uuid":"198709586","full_name":"sammarks/workflow","owner":"sammarks","description":"A node package for executing simple workflows with rollback support.","archived":false,"fork":false,"pushed_at":"2024-02-25T18:14:21.000Z","size":356,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T01:15:15.579Z","etag":null,"topics":["node","rollback-support","step","step-functions","typescript","workflows"],"latest_commit_sha":null,"homepage":"https://sammarks.github.io/workflow/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-24T21:04:47.000Z","updated_at":"2022-03-11T16:20:55.000Z","dependencies_parsed_at":"2024-10-02T02:20:40.366Z","dependency_job_id":null,"html_url":"https://github.com/sammarks/workflow","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fworkflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fworkflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fworkflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammarks%2Fworkflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammarks","download_url":"https://codeload.github.com/sammarks/workflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231785225,"owners_count":18426289,"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":["node","rollback-support","step","step-functions","typescript","workflows"],"created_at":"2024-10-02T02:20:34.666Z","updated_at":"2024-12-29T21:16:50.346Z","avatar_url":"https://github.com/sammarks.png","language":"TypeScript","funding_links":["https://paypal.me/sammarks15"],"categories":[],"sub_categories":[],"readme":"![][header-image]\n\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/sammarks/workflow/Build%20and%20Release)\n[![Coveralls](https://img.shields.io/coveralls/sammarks/workflow.svg)](https://coveralls.io/github/sammarks/workflow)\n[![Dev Dependencies](https://david-dm.org/sammarks/workflow/dev-status.svg)](https://david-dm.org/sammarks/workflow?type=dev)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/sammarks15)\n\n`workflow` is a Node JS library designed to facilitate the execution of simple workflows with\nrollback support. This allows you to take small units of code and combine them together into\na larger workflow to accomplish a single large task.\n\nSee [the documentation](https://sammarks.github.io/workflow/) for more details.\n\n## Get Started\n\n```sh\nnpm install @sammarks/workflow\nyarn add @sammarks/workflow\n```\n\n```typescript\nimport { execute } from '@sammarks/workflow'\n\ninterface WorkflowContext {\n  firstStepRun: boolean\n  secondStepRun: boolean\n  test: string\n}\n\nconst workflow = [\n  {\n    name: 'first',\n    run: async (context: WorkflowContext): Promise\u003cvoid\u003e =\u003e {\n      context.firstStepRun = true\n    },\n    revert: async (context: WorkflowContext): Promise\u003cvoid\u003e =\u003e {\n      context.firstStepRun = false\n    }\n  },\n  {\n    name: 'second',\n    run: async (context: WorkflowContext): Promise\u003cvoid\u003e =\u003e {\n      context.secondStepRun = true\n    },\n    revert: async (context: WorkflowContext): Promise\u003cvoid\u003e =\u003e {\n      context.secondStepRun = false\n    }\n  }\n]\n\nconst result = await execute\u003cWorkflowContext\u003e('test-workflow', workflow, { test: 'foo' })\nconsole.log(result)\n\n// {\n//   firstStepRun: true,\n//   secondStepRun: true,\n//   test: 'foo'\n// }\n```\n\n## Features\n\n- Define steps in a simple, typed, array-object format.\n- Steps and workflows are given names for debugging support.\n- Rollback support in case a step fails.\n- Predictable and documented error handling in case something goes wrong.\n\n## Why use this?\n\nBreaking the large task into smaller units of code allows a less complicated end result, and greater\nunit testing abilities since each step in the workflow is broken into its own function.\n\nRollback support allows a transactional nature for executing workflows. If one step in the process\nfails to execute, all previously-executed steps with a configured rollback are executed.\n\n`workflow` provides TypeScript hinting and a predictable error interface to handle issues when they\narise.\n\n[header-image]: https://raw.githubusercontent.com/sammarks/art/master/workflow/header.jpg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fworkflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammarks%2Fworkflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammarks%2Fworkflow/lists"}