get-convex / get-convex/workflow

Return lazy promises from steps instead of concrete values

Open
#33 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
81
Forks
17
Avg merge
1d 3h
Merged PRs (30d)
4

Description

Return promises of values instead of values, so once steps that depend on a value have run, the values aren't loaded when evaluating later steps

```ts
const lazyEmbedding = await step.runAction(..., { lazy: true });

const foo = await step.runMutation(api.foo.bar, { embedding: lazyEmbedding });
```
the args are now `LazyValue` where `LazyValue` is either a `Value` or `Promise` for primitives, or `LazyValue[]` or `Record` or `{ [K in keyof T]: T[K] | Promise }`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.