{"id":24486850,"url":"https://github.com/neuroglia-io/workflowcore.http","last_synced_at":"2025-03-14T22:45:58.933Z","repository":{"id":132549664,"uuid":"306713297","full_name":"neuroglia-io/WorkflowCore.Http","owner":"neuroglia-io","description":".NET CORE 3.1 library that defines HTTP workflow steps for the WorkflowCore workflow engine","archived":false,"fork":false,"pushed_at":"2020-11-17T11:50:48.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-22T05:47:16.910Z","etag":null,"topics":["aspnetcore","dotnet","http","workflowcore"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuroglia-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-10-23T18:12:27.000Z","updated_at":"2022-01-27T05:39:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"7114d7a7-9cf7-4a91-bd97-c50b8af0026f","html_url":"https://github.com/neuroglia-io/WorkflowCore.Http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroglia-io%2FWorkflowCore.Http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroglia-io%2FWorkflowCore.Http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroglia-io%2FWorkflowCore.Http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuroglia-io%2FWorkflowCore.Http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuroglia-io","download_url":"https://codeload.github.com/neuroglia-io/WorkflowCore.Http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658195,"owners_count":20326464,"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":["aspnetcore","dotnet","http","workflowcore"],"created_at":"2025-01-21T15:20:15.593Z","updated_at":"2025-03-14T22:45:58.914Z","avatar_url":"https://github.com/neuroglia-io.png","language":"C#","readme":"# WorkflowCore.Http\n\n.NET CORE 3.1 library that defines HTTP workflow steps for the [WorkflowCore](https://github.com/danielgerlag/workflow-core/) workflow engine\n\n# Usage\n\n[Nuget Package](https://www.nuget.org/packages/WorkflowCore.Http/)\n\n```\n  dotnet add package WorkflowCore.Http\n```\n\n# Sample code\n\n## Configuration\n\n```C#\npublic class Startup\n{\n\n    public void ConfigureServices(IServiceCollection services)\n    {\n        services.AddHttpClient();\n        services.AddWorkflow();\n        services.AddHttpWorkflow();\n        services.AddControllers();\n    }\n\n    public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IWorkflowHost workflowHost)\n    {\n        if (env.IsDevelopment())\n            app.UseDeveloperExceptionPage();\n        app.UseRouting();\n        app.UseHttpWorkflow();\n        app.UseEndpoints(endpoints =\u003e\n        {\n            endpoints.MapControllers();\n        });\n        workflowHost.Start();\n    }\n\n}\n```\n\n## Workflow usage\n\n```C#\nbuilder.StartWith(context =\u003e\n{\n    Console.WriteLine(\"Begining saga\");\n})\n    .Saga(saga =\u003e\n    {\n        saga\n            .StartWith(context =\u003e Console.WriteLine(\"Saga started\"))\n            .Then\u003cSendHttpRequest\u003e(setup =\u003e\n            {\n                setup.Input(step =\u003e step.Method, data =\u003e HttpMethod.Post);\n                setup.Input(step =\u003e step.Uri, data =\u003e \"http://localhost/workflow/execute\");\n                setup.Input(step =\u003e step.RetryPolicy, data =\u003e Policy\n                    .Handle\u003cHttpRequestException\u003e(ex =\u003e ex.Message.Contains(\"400\"))\n                    .RetryAsync(4, (ex, attempts) =\u003e Console.WriteLine($\"Attempt n°{attempts}\")));\n                setup.Input(step =\u003e step.Content, data =\u003e new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, MediaTypeNames.Application.Json));\n            })\n                .CompensateWith\u003cSendHttpRequest\u003e(setup =\u003e\n                    {\n                        setup.Input(step =\u003e step.Method, data =\u003e HttpMethod.Get);\n                        setup.Input(step =\u003e step.Uri, data =\u003e \"http://localhost:56832/workflow/compensate\");\n                    })\n            .Then\u003cReceiveHttpRequest\u003e(setup =\u003e\n            {\n                setup.Input(step =\u003e step.Method, data =\u003e HttpMethod.Get);\n                setup.Input(step =\u003e step.Path, data =\u003e \"/test/go\");\n            })\n            .Then(context =\u003e Console.WriteLine(\"Saga ended\"));\n    });\n```\n\n\n# Contributing\n\nPlease see [CONTRIBUTING.md](https://github.com/neuroglia-io/WorkflowCore.Http/blob/master/CONTRIBUTING.md) for instructions on how to contribute.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuroglia-io%2Fworkflowcore.http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuroglia-io%2Fworkflowcore.http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuroglia-io%2Fworkflowcore.http/lists"}