{"id":19385778,"url":"https://github.com/vkkis93/serverless-step-functions-offline","last_synced_at":"2025-04-06T22:10:20.727Z","repository":{"id":28045897,"uuid":"115734980","full_name":"vkkis93/serverless-step-functions-offline","owner":"vkkis93","description":"Emulate step functions locally when developing your Serverless project","archived":false,"fork":false,"pushed_at":"2024-04-16T00:41:13.000Z","size":593,"stargazers_count":78,"open_issues_count":57,"forks_count":40,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T20:12:38.085Z","etag":null,"topics":["aws","aws-lambda","lambda","serverless","serverless-step-functions-offline","sls","state-machine","step-functions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/vkkis93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2017-12-29T15:53:31.000Z","updated_at":"2024-06-22T21:50:43.000Z","dependencies_parsed_at":"2024-06-18T18:12:20.048Z","dependency_job_id":"f46e94da-c364-422e-bbbf-602483681ede","html_url":"https://github.com/vkkis93/serverless-step-functions-offline","commit_stats":{"total_commits":78,"total_committers":5,"mean_commits":15.6,"dds":"0.10256410256410253","last_synced_commit":"91071b61df7e56cecb8d6f70c171b833e3dc35e4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkkis93%2Fserverless-step-functions-offline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkkis93%2Fserverless-step-functions-offline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkkis93%2Fserverless-step-functions-offline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkkis93%2Fserverless-step-functions-offline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vkkis93","download_url":"https://codeload.github.com/vkkis93/serverless-step-functions-offline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["aws","aws-lambda","lambda","serverless","serverless-step-functions-offline","sls","state-machine","step-functions"],"created_at":"2024-11-10T10:03:02.504Z","updated_at":"2025-04-06T22:10:20.693Z","avatar_url":"https://github.com/vkkis93.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![npm version](https://badge.fury.io/js/serverless-step-functions-offline.svg)](https://badge.fury.io/js/serverless-step-functions-offline)\n[![Known Vulnerabilities](https://snyk.io/test/github/vkkis93/serverless-step-functions-offline/badge.svg?targetFile=package.json)](https://snyk.io/test/github/vkkis93/serverless-step-functions-offline?targetFile=package.json)\n[![Maintainability](https://api.codeclimate.com/v1/badges/b321644ef368976aee12/maintainability)](https://codeclimate.com/github/vkkis93/serverless-step-functions-offline/maintainability)\n[![NPM](https://nodei.co/npm/serverless-step-functions-offline.png)](https://nodei.co/npm/serverless-step-functions-offline/)\n\n# serverless-step-functions-offline\n:warning: Version 2.0 with breaking changes see [usage](#usage)  :warning:\n## Documentation\n\n- [Install](#install)\n- [Setup](#setup)\n- [Requirements](#requirements)\n- [Usage](#usage)\n- [Run plugin](#run-plugin)\n- [What does plugin support](#what-does-plugin-support)\n- [Usage with serverless-wepback](#usage-with-serverless-webpack)\n\n\n# Install\nUsing NPM:\n```bash\nnpm install serverless-step-functions-offline --save-dev\n```\nor Yarn:\n```bash\nyarn add serverless-step-functions-offline --dev\n```\n\n# Setup\nAdd the plugin to your `serverless.yml`:\n```yaml\n# serverless.yml\n\nplugins:\n  - serverless-step-functions-offline\n```\n\nTo verify that the plugin works, run this in your command line:\n```bash\nsls step-functions-offline\n```\n\nIt should rise an error like that:\n\n\u003e Serverless plugin \"serverless-step-functions-offline\" initialization errored: Please add ENV_VARIABLES to section \"custom\"\n\n# Requirements\nThis plugin works only with [serverless-step-functions](https://github.com/horike37/serverless-step-functions).\n\nYou must have this plugin installed and correctly specified statemachine definition using Amazon States Language.\n\nExample of statemachine definition you can see [here](https://github.com/horike37/serverless-step-functions#setup).\n\n# Usage\nAfter all steps are done, need to add to section **custom** in serverless.yml the key **stepFunctionsOffline** with properties *stateName*: name of lambda function.\n\nFor example:\n\n```yaml\nservice: ServerlessStepPlugin\nframeworkVersion: \"\u003e=1.13.0 \u003c2.0.0\"\nplugins:\n   - serverless-step-functions-offline\n\n# ...\n\ncustom:\n  stepFunctionsOffline:\n    FirstLambda: firstLambda #(v2.0)\n    # ...\n    # ...\n    SecondLambda: secondLambda #(v2.0)\n\nfunctions:\n    firstLambda:\n        handler: firstLambda/index.handler\n        name: TheFirstLambda\n    secondLambda:\n        handler: secondLambda/index.handler\n        name: TheSecondLambda\nstepFunctions:\n  stateMachines:\n    foo:\n      definition:\n        Comment: \"An example of the Amazon States Language using wait states\"\n        StartAt: FirstLambda\n        States:\n            FirstLambda:\n              Type: Task\n              Resource: arn:aws:lambda:eu-west-1:123456789:function:TheFirstLambda\n              Next: SecondLambda\n            SecondLambda:\n              Type: Task\n              Resource: arn:aws:lambda:eu-west-1:123456789:function:TheSecondLambda\n              End: true\n```\n\nWhere:\n- `StepOne` is the name of step in state machine\n- `firstLambda` is the name of function in section **functions**\n\n# Run Plugin\n```bash\nsls step-functions-offline --stateMachine={{name}} --event={{path to event file}}\n```\n\n- `name`: name of state machine in section state functions. In example above it's `foo`.\n- `event`: input values for execution in JSON format (optional)\n\nIf you want to know where you are (in offline mode or not) you can use env variable `STEP_IS_OFFLINE`.\n\nBy default `process.env.STEP_IS_OFFLINE = true`.\n\n# What does plugin support?\n| States | Support |\n| ------ | ------ |\n| ***Task*** | At this moment  plugin **does not support fields** *Retry*, *Catch*, *TimeoutSeconds*, *HeartbeatSeconds* |\n| ***Choice*** | All comparison operators except: *And*, *Not*, *Or* |\n| ***Wait***  | All following fields: *Seconds*, *SecondsPath*, *Timestamp*, *TimestampPath* |\n| ***Parallel*** |  Only *Branches* |\n| ***Pass*** | Result, ResultPath |\n| ***Fail***| Cause, Error|\n| ***Succeed***| |\n\n### Usage with serverless-webpack\n\nThe plugin integrates very well with [serverless-webpack](https://github.com/serverless-heaven/serverless-webpack).\n\nAdd the plugins `serverless-webpack` to your `serverless.yml` file and make sure that `serverless-webpack`\nprecedes `serverless-step-functions-offline` as the order is important:\n```yaml\n  plugins:\n    ...\n    - serverless-webpack\n    ...\n    - serverless-step-functions-offline\n    ...\n```\n\n### TODOs\n - [x] Support context object\n - [x] Improve performance\n - [x] Fixing bugs\n - [x] Support Pass, Fail, Succeed\n - [x] Integration with serverless-webpack\n - [ ] Add unit tests - to make plugin stable (next step)\n - [ ] Support fields *Retry*, *Catch*\n - [ ] Support other languages except node.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkkis93%2Fserverless-step-functions-offline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvkkis93%2Fserverless-step-functions-offline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkkis93%2Fserverless-step-functions-offline/lists"}