{"id":17262815,"url":"https://github.com/darwin67/inngest-ex","last_synced_at":"2025-04-14T07:33:35.251Z","repository":{"id":172132907,"uuid":"646002880","full_name":"darwin67/inngest-ex","owner":"darwin67","description":"Elixir SDK for Inngest","archived":false,"fork":false,"pushed_at":"2024-06-02T20:16:17.000Z","size":521,"stargazers_count":16,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T09:10:28.080Z","etag":null,"topics":["elixir","elixir-lang","elixir-library","execution-engine","inngest","inngest-sdk","workflow-engine"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/inngest/Inngest.html","language":"Elixir","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/darwin67.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-05-27T01:39:31.000Z","updated_at":"2025-04-09T10:25:21.000Z","dependencies_parsed_at":"2023-11-30T05:22:51.753Z","dependency_job_id":"eaf5486f-38d6-42d3-9ad0-24d00565bcde","html_url":"https://github.com/darwin67/inngest-ex","commit_stats":null,"previous_names":["darwin67/ex-inngest","darwin67/ex_inngest","inngest/ex_inngest"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darwin67%2Finngest-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darwin67%2Finngest-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darwin67%2Finngest-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darwin67%2Finngest-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darwin67","download_url":"https://codeload.github.com/darwin67/inngest-ex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248839524,"owners_count":21169826,"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":["elixir","elixir-lang","elixir-library","execution-engine","inngest","inngest-sdk","workflow-engine"],"created_at":"2024-10-15T07:54:48.026Z","updated_at":"2025-04-14T07:33:35.215Z","avatar_url":"https://github.com/darwin67.png","language":"Elixir","readme":"\u003c!-- MDOC ! --\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.inngest.com\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/306177/191580717-1f563f4c-31e3-4aa0-848c-5ddc97808a9a.png\" width=\"300\" /\u003e\u003c/a\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cp\u003e\n    A durable event-driven workflow engine SDK for Elixir.\u003cbr /\u003e\n    Read the \u003ca href=\"https://www.inngest.com/docs?ref=github-inngest-elixir-readme\"\u003edocumentation\u003c/a\u003e and get started in minutes.\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/darwin67/ex-inngest/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/darwin67/ex-inngest/actions/workflows/ci.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/inngest/ex_inngest\" \u003e\u003cimg src=\"https://codecov.io/gh/inngest/ex_inngest/graph/badge.svg?token=t7231eD24T\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://hex.pm/packages/inngest\"\u003e\u003cimg src=\"https://img.shields.io/hexpm/v/inngest.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://hexdocs.pm/inngest/\"\u003e\u003cimg src=\"https://img.shields.io/badge/hex-docs-lightgreen.svg\" /\u003e\u003c/a\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://www.inngest.com/discord\"\u003e\u003cimg src=\"https://img.shields.io/discord/842170679536517141?label=discord\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/inngest\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/inngest?style=social\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# [Inngest](https://www.inngest.com) Elixir SDK\n\nInngest's Elixir SDK allows you to create event-driven, durable workflows in your\nexisting API — without new infrastructure.\n\nIt's useful if you want to build reliable software without worrying about queues,\nevents, subscribers, workers, or other complex primitives such as concurrency,\nparallelism, event batching, or distributed debounce. These are all built in.\n\n## Installation\n\nThe Elixir SDK can be downloaded from [Hex](https://hex.pm/packages/inngest). Add it\nto your list of dependencies in `mix.exs`\n\n``` elixir\n# mix.exs\ndef deps do\n  [\n    {:inngest, \"~\u003e 0.2\"}\n  ]\nend\n```\n\n### Example\n\nThis is a basic example of what an Inngest function will look like.\n\nA Module can be turned into an Inngest function easily by using the `Inngest.Function`\nmacro.\n\n``` elixir\ndefmodule MyApp.AwesomeFunction do\n  use Inngest.Function\n\n  @func %FnOpts{id: \"awesome-fn\", name: \"Awesome Function\"} # The id and name of the function\n  @trigger %Trigger{event: \"func/awesome\"} # The event this function will react to\n\n  @impl true\n  def exec(_ctx, _input) do\n    IO.inspect(\"Do something\")\n\n    {:ok, \"hello world\"}\n  end\nend\n```\n\nAnd just like that, you have an Inngest function that will react to an event called `func/awesome`.\n`Inngest.Function.exec/2` will then be called by the SDK to run and execute the logic.\n\n#### Advanced\n\nThe above example will be no different from other background processing libraries, so let's take a\nlook at a more complicated version. Which should provide you an idea what is capable with Inngest.\n\n``` elixir\ndefmodule MyApp.AwesomeFunction do\n  use Inngest.Function\n\n  @func %FnOpts{id: \"awesome-fn\", name: \"Awesome Function\"} # The id and name of the function\n  @trigger %Trigger{event: \"func/awesome\"} # The event this function will react to\n\n  @impl true\n  def exec(ctx, %{step: step} = input) do\n    IO.inspect(\"Starting function...\")\n\n    %{greet: greet} =\n      # A return value wrapped in a `step` are memorized, meaning\n      # it's guaranteed to be idempotent.\n      # if it fails, it'll be retried.\n      step.run(ctx, \"step1\", fn -\u003e\n        %{greet: \"hello\"}\n      end)\n\n    # Sleeping will pause the execution from running, and function\n    # will be reinvoked when time is up.\n    step.sleep(ctx, \"wait-a-little\", \"10s\")\n\n    %{name: name} =\n      step.run(ctx, \"retrieve-user\", fn -\u003e\n        # retrieve user from here\n        %{name: user_name}\n      end)\n\n    # There are times you want to wait for something to happen before\n    # continue on the workflow. `wait_for_event` allows exactly that.\n    evt = step.wait_for_event(\"wait-for-registration-complete\", %{\n      event: \"user/register.completed\",\n      timeout: \"1h\"\n    })\n\n    # You might want to trigger some other workflow, sending an event\n    # will trigger the functions that are registered against the `event`.\n    step.send_event(\"completed-work\", %{\n      name: \"func/awesome.completed\",\n      data: %{name: name}\n    })\n\n    {:ok, %{greetings: \"#{greet} #{name}\", registered: is_nil(evt)}}\n  end\nend\n```\n\nSee the **[guides](https://hexdocs.pm/inngest)** for more details regarding use cases and how each macros can be used.\n\n\u003c!-- MDOC ! --\u003e\n\n[inngest]: https://www.inngest.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarwin67%2Finngest-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarwin67%2Finngest-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarwin67%2Finngest-ex/lists"}