Interactive workflows, such as human-in-the-loop approvals or chat interfaces, require systems to feed data into a process while it runs. Previously, tasks operated mostly in a unidirectional flow.
Tasks can now define typed to receive data mid-execution. A task can be entirely suspended while waiting for a single external payload, or it can remain alive to of incoming messages. Outside the task, external backends and frontends can send data directly to these specific runs using a standard API or a provided .
Under the hood, suspended tasks rely on internal waitpoints mapped via a Redis cache, ensuring minimal latency when the external data finally arrives. The underlying event streaming relies on an upgraded version of the S2 streamstore SDK, which now includes local development support.
Here is how a task awaits external input:
1const approval = streams.input<{ approved: boolean }>({ id: "approval" });2const result = await approval.wait({ timeout: "5m" });
