inngest-cli 0.25.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +58 -45
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,44 +1,44 @@
1
- # [![Inngest](https://github.com/inngest/.github/raw/main/profile/github-readme-banner.png)](https://www.inngest.com)
1
+ # [![Inngest](https://github.com/inngest/.github/raw/main/profile/github-readme-banner-2024-01-26.png)](https://www.inngest.com)
2
2
 
3
3
  [![Latest release](https://img.shields.io/github/v/release/inngest/inngest?include_prereleases&sort=semver)](https://github.com/inngest/inngest/releases)
4
4
  [![Test Status](https://img.shields.io/github/actions/workflow/status/inngest/inngest/go.yaml?branch=main&label=tests)](https://github.com/inngest/inngest/actions?query=branch%3Amain)
5
5
  [![Discord](https://img.shields.io/discord/842170679536517141?label=discord)](https://www.inngest.com/discord)
6
6
  [![Twitter Follow](https://img.shields.io/twitter/follow/inngest?style=social)](https://twitter.com/inngest)
7
7
 
8
- [Inngest](https://www.inngest.com) is the developer platform for easily building reliable workflows with zero infrastructure.
8
+ [Inngest](https://www.inngest.com) is a developer platform that combines event streams, queues, and durable execution into a single reliability layer.
9
9
 
10
10
  <div align="center">
11
+ <a href="https://www.inngest.com/uses/durable-workflows?ref=org-readme">
12
+ Durable workflows
13
+ </a>&nbsp;&nbsp;|&nbsp;&nbsp;
11
14
 
12
- <a href="https://www.inngest.com/uses/serverless-node-background-jobs?ref=org-readme">
13
- Background Jobs
15
+ <a href="https://www.inngest.com/ai?ref=org-readme">
16
+ AI & LLM Chaining
14
17
  </a>&nbsp;&nbsp;|&nbsp;&nbsp;
15
18
 
16
19
  <a href="https://www.inngest.com/uses/serverless-queues?ref=org-readme">
17
20
  Serverless Queues
18
21
  </a>&nbsp;&nbsp;|&nbsp;&nbsp;
19
22
 
20
- <a href="https://www.inngest.com/docs/functions/multi-step?ref=org-readme">
21
- Workflows
22
- </a>&nbsp;&nbsp;|&nbsp;&nbsp;
23
-
24
- <a href="https://www.inngest.com/uses/zero-infra-llm-ai?ref=org-readme">
25
- AI & LLM Chains
26
- </a>&nbsp;&nbsp;|&nbsp;&nbsp;
27
-
28
- <a href="https://www.inngest.com/uses/serverless-cron-jobs?ref=org-readme">
29
- Scheduled Jobs
23
+ <a href="https://www.inngest.com/uses/workflow-engine?ref=org-readme">
24
+ Workflow Engines
30
25
  </a>
31
26
  </div>
32
27
  <br/>
33
28
 
34
- - Write background jobs and workflows in your existing codebase using the [**Inngest SDK**](https://github.com/inngest/inngest-js)
35
- - Run the open source [**Inngest Dev Server**](#the-inngest-dev-server) on your machine for a complete local development experience, with production parity.
29
+ Build and ship durable functions and workflows **in your current codebase** without any additional infrastructure. Using Inngest, your entire team can ship reliable products.
30
+
31
+ - Write durable functions in your existing codebase using an [**Inngest SDK**](#sdks)
32
+ - Run the open source [**Inngest Dev Server**](#the-inngest-dev-server) for a complete local development experience, with production parity.
36
33
  - The **Inngest Platform** invokes your code wherever you host it, via HTTPS. Deploy to your existing setup, and deliver products faster without managing infrastructure.
37
34
 
35
+ **SDKs**: [TypeScript/JavaScript](https://github.com/inngest/inngest-js) &mdash; [Python](https://github.com/inngest/inngest-py) &mdash; [Go](https://github.com/inngest/inngestgo)
36
+
38
37
  ---
39
38
 
40
39
  - [Overview](#overview)
41
- - [Quick Start](#quick-start)
40
+ - [SDKs](#sdks)
41
+ - [Getting started](#getting-started)
42
42
  - [Project Architecture](#project-architecture)
43
43
  - [Community](#community)
44
44
 
@@ -56,63 +56,76 @@ npx inngest-cli@latest dev
56
56
 
57
57
  ## Overview
58
58
 
59
- Inngest makes it easy to develop serverless workflows in your existing codebase, without any new infrastructure. Inngest Functions are triggered via events &mdash; decoupling your code within your application.
59
+ Inngest makes it easy to develop durable functions and workflows in your existing codebase, without any new infrastructure. Inngest Functions are triggered via events &mdash; decoupling your code within your application.
60
60
 
61
- 1. You define your Inngest functions using the [Inngest SDK](https://github.com/inngest/inngest-js) and serve them through a [simple API endpoint](https://www.inngest.com/docs/sdk/serve?ref=github-inngest-readme).
61
+ 1. You define your Inngest functions using the [Inngest SDK](#sdks) and serve them through a [simple API endpoint](https://www.inngest.com/docs/sdk/serve?ref=github-inngest-readme).
62
62
  2. Inngest automatically invokes your functions via HTTPS whenever you send events from your application.
63
63
 
64
- Inngest abstracts the complex parts of building a robust, reliable, and scalable architecture away from you, so you can focus on writing amazing code and building applications for your users.
64
+ Inngest abstracts the complex parts of building a robust, reliable, and scalable architecture away from you, so you can focus on building applications for your users.
65
65
 
66
66
  - **Run your code anywhere** - We call you via HTTPS so you can deploy your code to serverless, servers or the edge.
67
67
  - **Zero-infrastructure required** - No queues or workers to configure or manage &mdash; just write code and Inngest does the rest.
68
- - **Build complex workflows with simple primitives** - [Our SDK](https://github.com/inngest/inngest-js) provides easy to learn `step` tools like [`run`](https://www.inngest.com/docs/reference/functions/step-run?ref=github-inngest-readme), [`sleep`](https://www.inngest.com/docs/reference/functions/step-sleep?ref=github-inngest-readme), [`sleepUntil`](https://www.inngest.com/docs/reference/functions/step-sleep-until?ref=github-inngest-readme), and [`waitForEvent`](https://www.inngest.com/docs/reference/functions/step-wait-for-event?ref=github-inngest-readme) that you can combine using code and patterns that you're used to create complex and robust workflows.
68
+ - **Build complex workflows with simple primitives** - Our [SDKs](#sdks) provides easy to learn `step` tools like [`run`](https://www.inngest.com/docs/reference/functions/step-run?ref=github-inngest-readme), [`sleep`](https://www.inngest.com/docs/reference/functions/step-sleep?ref=github-inngest-readme), [`sleepUntil`](https://www.inngest.com/docs/reference/functions/step-sleep-until?ref=github-inngest-readme), and [`waitForEvent`](https://www.inngest.com/docs/reference/functions/step-wait-for-event?ref=github-inngest-readme) that you can combine using code and patterns that you're used to create complex and robust workflows.
69
69
 
70
70
  [Read more about our vision and why Inngest exists](https://www.inngest.com/blog/inngest-add-super-powers-to-serverless-functions)
71
71
 
72
- <br />
72
+ ---
73
73
 
74
- ## Quick Start
74
+ ## SDKs
75
75
 
76
- 👉 [Read the full quick start guide here](https://www.inngest.com/docs/quick-start?ref=github-inngest-readme)
76
+ - **TypeScript / JavaScript** ([inngest-js](<(https://github.com/inngest/inngest-js)>)) - [Reference](https://www.inngest.com/docs/reference/typescript)
77
+ - **Python** ([inngest-py](https://github.com/inngest/inngest-py)) - [Reference](https://www.inngest.com/docs/reference/python)
78
+ - **Go** ([inngestgo](https://github.com/inngest/inngestgo)) - [Reference](https://pkg.go.dev/github.com/inngest/inngestgo)
77
79
 
78
- 1. [NPM install our SDK for your typescript project](https://github.com/inngest/inngest-js): `npm install inngest`
79
- 2. Run the Inngest dev server: `npx inngest-cli@latest dev` (This repo's CLI)
80
- 3. [Integrate Inngest with your framework in one line](https://www.inngest.com/docs/sdk/serve?ref=github-inngest-readme) via the `serve()` handler
81
- 4. [Write and run functions in your existing framework or project](https://www.inngest.com/docs/functions?ref=github-inngest-readme)
80
+ ## Getting started
82
81
 
83
- Here's an example:
82
+ 👉 [**Follow the full quick start guide here**](https://www.inngest.com/docs/quick-start?ref=github-inngest-readme)
83
+
84
+ ### A brief example
85
+
86
+ Here is an example of an Inngest function that sends a welcome email when a user signs up to an application. The function sleeps for 4 days and sends a second product tips email:
84
87
 
85
88
  ```ts
86
- import { Inngest } from "inngest";
89
+ import { Inngest } from 'inngest';
87
90
 
88
- const inngest = new Inngest({ id: "my-app" });
91
+ const inngest = new Inngest({ id: 'my-app' });
89
92
 
90
- // This function will be invoked by Inngest via HTTP any time the "app/user.signup"
91
- // event is sent to to Inngest
93
+ // This function will be invoked by Inngest via HTTP any time
94
+ // the "app/user.signup" event is sent to to Inngest
92
95
  export default inngest.createFunction(
93
- { name: "User onboarding communication" },
94
- { event: "app/user.signup" },
96
+ { id: 'user-onboarding-emails' },
97
+ { event: 'app/user.signup' },
95
98
  async ({ event, step }) => {
96
- await step.run("Send welcome email", async () => {
97
- await sendEmail({
98
- email: event.data.email,
99
- template: "welcome",
100
- });
99
+ await step.run('send-welcome-email', async () => {
100
+ await sendEmail({ email: event.data.email, template: 'welcome' });
101
+ });
102
+
103
+ await step.sleep('delay-follow-up-email', '7 days');
104
+
105
+ await step.run('send-tips-email', async () => {
106
+ await sendEmail({ email: event.data.email, template: 'product-tips' });
101
107
  });
102
108
  }
103
109
  );
104
110
 
105
111
  // Elsewhere in your code (e.g. in your sign up handler):
106
-
107
- inngest.send({
108
- name: "app/user.signup",
112
+ await inngest.send({
113
+ name: 'app/user.signup',
109
114
  data: {
110
- email: "test@example.com",
115
+ email: 'test@example.com',
111
116
  },
112
117
  });
113
118
  ```
114
119
 
115
- That's it - your function is set up!
120
+ Some things to highlight about the above code:
121
+
122
+ - Code within each `step.run` is automatically retried on error.
123
+ - Each `step.run` is individually executed via HTTPS ensuring errors do not result in lost work from previous steps.
124
+ - State from previous steps is memoized so code within steps is not re-executed on retries.
125
+ - Functions can `sleep` for hours, days, or months. Inngest stops execution and continues at the exactly the right time.
126
+ - Events can trigger one or more functions via [fan-out](https://www.inngest.com/docs/guides/fan-out-jobs)
127
+
128
+ Learn more about writing Inngest functions in [our documentation](https://www.inngest.com/docs).
116
129
 
117
130
  <br />
118
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inngest-cli",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "description": "The event-driven queue for any language.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {