inngest / inngest-js

The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
https://www.inngest.com/
GNU General Public License v3.0
414 stars 41 forks source link

INN-2223 Add `step.invoke()` and basis for `inngest.invoke()` #368

Closed jpwilliams closed 10 months ago

jpwilliams commented 11 months ago

Summary

Adds function invocation using steps.

const result = await step.invoke("get-user-details", {
  function: exampleFn,
  data: { message: "Hai!" },
});

const cronResult = await step.invoke("trigger-cron", {
  function: cronOnlyFn,
});

This is part of a larger change to add direct function invocation via step.invoke(), inngest.invoke(), and fn.invoke().

Checklist

Related

changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: 957159f24a2bbe23375f24045f5e38a83b96be43

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------- | ----- | | inngest | Minor |

Not sure what this means? Click here to learn what changesets are.

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/inngest/inngest-js/new/feat/invocation?filename=.changeset/weak-shirts-check.md&value=---%0A%22inngest%22%3A%20patch%0A---%0A%0AINN-2223%20Add%20%60step.invoke()%60%20and%20basis%20for%20%60inngest.invoke()%60%0A)

inngest-release-bot commented 10 months ago

A user has added the prerelease/inngest label, so this PR will be published to npm with the tag pr-368. It will be updated with the latest changes as you push commits to this PR.

You can install this prerelease version with:

npm install inngest@pr-368

The last release was built and published from 957159f24a2bbe23375f24045f5e38a83b96be43.