Does .create() with same token return same promise?

HEAD
74aea7bAdd DurableAgent compat tests, e2e tests, and migrate to AI SDK v6 (#1362)
This post might have stale content, as HEAD is 861 commits ahead.

can i do someHook.create({token}) and then in another nested function (where the hook is not in scope), do someHook.create({token}) again, and then await it, and it be the same hook/promise? i'm uncertain about what .create does under the hood, and if creating with the same token goes to the same promise as i'd expect, or not.

Avatar of julianbenegas
Julian Benegas
commented

nice, this makes sense. can hooks be sent down to step functions? i would think "no", right?

Avatar of julianbenegas
Julian Benegas
commented

is there a way to strip unserializable stuff before facing an error? i have an array of "events" and hooks might be a prop in there, and the full array is passed down - i'd prefer to have the unserializable stuff stripped other than getting a runtime error


END OF POST

Does .create() with same token return same promise? — vercel/workflow