{"id":24115976,"url":"https://github.com/psibr/restate","last_synced_at":"2025-04-05T03:10:13.026Z","repository":{"id":22147489,"uuid":"95423861","full_name":"psibr/REstate","owner":"psibr","description":"Portable state-flows (state-machine based workflows)","archived":false,"fork":false,"pushed_at":"2024-10-25T06:39:32.000Z","size":1119,"stargazers_count":36,"open_issues_count":24,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T14:40:20.400Z","etag":null,"topics":["dot-graph","dotnet","grpc","msgpack","netstandard","nuget","restate","state-machine"],"latest_commit_sha":null,"homepage":"","language":"C#","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/psibr.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":"2017-06-26T08:11:52.000Z","updated_at":"2024-06-17T03:15:23.000Z","dependencies_parsed_at":"2024-01-18T18:40:00.225Z","dependency_job_id":"a5b08b5c-c1d4-4643-895e-edc6d860dd65","html_url":"https://github.com/psibr/REstate","commit_stats":{"total_commits":259,"total_committers":10,"mean_commits":25.9,"dds":"0.17760617760617758","last_synced_commit":"0a3ae3b6d3c5dbf368385476ea4eec2aa5defbb2"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibr%2FREstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibr%2FREstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibr%2FREstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psibr%2FREstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psibr","download_url":"https://codeload.github.com/psibr/REstate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":["dot-graph","dotnet","grpc","msgpack","netstandard","nuget","restate","state-machine"],"created_at":"2025-01-11T06:14:47.560Z","updated_at":"2025-04-05T03:10:12.980Z","avatar_url":"https://github.com/psibr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/8ql1gahqjxcl8nlx/branch/master?svg=true)](https://ci.appveyor.com/project/psibr/restate-wuhpb/branch/master)\n[![AppVeyor tests](https://img.shields.io/appveyor/tests/psibr/restate-wuhpb.svg?logo=appveyor)](https://ci.appveyor.com/project/psibr/restate-wuhpb/build/tests)\n\n[![NuGet REstate Release](https://img.shields.io/nuget/v/REstate.svg?label=REstate)](https://www.nuget.org/packages/REstate)\n[![NuGet REstate Concurrency Primitives Release](https://img.shields.io/nuget/v/REstate.Concurrency.Primitives.svg?label=REstate.Concurrency.Primitives)](https://www.nuget.org/packages/REstate.Concurrency.Primitives)\n[![NuGet REstate Remote Release](https://img.shields.io/nuget/v/REstate.Remote.svg?label=REstate.Remote)](https://www.nuget.org/packages/REstate.Remote)\n\n[![NuGet REstate Redis Repo Release](https://img.shields.io/nuget/v/REstate.Engine.Repositories.Redis.svg?label=REstate.Engine.Repositories.Redis)](https://www.nuget.org/packages/REstate.Engine.Repositories.Redis)\n[![NuGet REstate EFCore Repo Release](https://img.shields.io/nuget/v/REstate.Engine.Repositories.Redis.svg?label=REstate.Engine.Repositories.EntityFrameworkCore)](https://www.nuget.org/packages/REstate.Engine.Repositories.EntityFrameworkCore)\n\n![REstate Logo](https://github.com/psibr/REstate/blob/master/assets/icons/REstate.svg) \n\u003e \"Android, bionic, hand, machine, palm, robot, technology icon\" by [designforeat](https://www.iconfinder.com/designforeat), used under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)/Partially rotated from original\n# REstate\n\nREstate is a portable state-flow system. It allows you to define a set of possible states that a program can exist in and what input will cause the transition between any two states. When it transitions into a given state, you can define an action that will execute arbitrary code. This can be used to build complex, but deterministic and predefined systems, such as workflow systems or distributed systems.\n\nA `Schematic` may be defined on one server or workstation, but then used on others. `REstateMachine`s can call arbitrary code through the connector system, provided the connector exists on the system where it is running.\n\n### Given the following REstate schematic, represented in DOT Graph:\n\n![EchoMachine Schematic in DOT Graph](https://github.com/psibr/REstate/blob/master/LoggerMachine-Diagram.svg)\n\n### Here is the code to build the schematic:\n\n```csharp\nvar schematic = REstateHost.Agent\n    .CreateSchematic\u003cstring, string\u003e(\"LoggerMachine\")\n\n    .WithState(\"Created\", state =\u003e state\n        .AsInitialState())\n\n    .WithState(\"Ready\", state =\u003e state\n        .WithTransitionFrom(\"Created\", \"log\")\n        .WithReentrance(\"log\")\n        .WithAction(\"log info\", onEntry =\u003e onEntry\n            .DescribedAs(\"Logs the payload as a message.\")\n            .WithSetting(\n                key: \"messageFormat\", \n                value: \"{schematicName}({machineId}) entered {state} on {input}. Message: {payload}\")))\n\n    .Build();\n```\n\n### Schematics are serializer friendly.\n\nThe same schematic in YML (YamlDotNet):\n\n```yml\nSchematicName: LoggerMachine\nInitialState: Created\nStates:\n- Value: Created\n  Transitions:\n  - Input: log\n    ResultantState: Ready\n- Value: Ready\n  Transitions:\n  - Input: log\n    ResultantState: Ready\n  Action:\n    ConnectorKey:\n      Identifier: log info\n    Configuration:\n      messageFormat: '{schematicName}({machineId}) entered {state} on {input}. Message: {payload}'\n    Description: Logs the payload as a message.\n\n```\nAs well as JSON or any other format really.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsibr%2Frestate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsibr%2Frestate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsibr%2Frestate/lists"}