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
440 stars 43 forks source link

Add `timeout` to `step.invoke()` options #484

Closed jpwilliams closed 9 months ago

jpwilliams commented 9 months ago

Summary

Adds a timeout option to step.invoke(), allowing users to specify a timeout other than the default when invoking a function as a step.

Uses the the same timeout as step.waitForEvent() and function config.

await step.invoke("Example", {
  function: myFn,
  timeout: "1h",
});

The Executor already supports this:

https://github.com/inngest/inngest/blob/658e7a6e003b1a3b4fb0f4349c3c7e635e09b9de/pkg/execution/state/driver_response.go#L159-L163

Checklist

Related

changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: 22681951865e9ae6b0c57e1c007ec5b3674e830a

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/invoke-timeout?filename=.changeset/soft-buses-relate.md&value=---%0A%22inngest%22%3A%20patch%0A---%0A%0AAdd%20%60timeout%60%20to%20%60step.invoke()%60%20options%0A)