From f173e3977eeaaaadf3ddac386e0707efddc373aa Mon Sep 17 00:00:00 2001 From: Josh Kline <194861906+jkline-trustle@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:02:00 -0800 Subject: [PATCH 1/2] Step input is not serialized In python only the step output is pickled, the input is not. --- docs/python/tutorials/step-tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/python/tutorials/step-tutorial.md b/docs/python/tutorials/step-tutorial.md index d6c557703..77b5aefc3 100644 --- a/docs/python/tutorials/step-tutorial.md +++ b/docs/python/tutorials/step-tutorial.md @@ -6,7 +6,7 @@ title: Steps When using DBOS workflows, we recommend annotating any function that performs complex operations or accesses external APIs or services as a _step_. You can turn **any** Python function into a step by annotating it with the [`@DBOS.step`](../reference/decorators.md#step) decorator. -The only requirement is that its inputs and outputs should be serializable ([pickle](https://docs.python.org/3/library/pickle.html)-able). +The only requirement is that its outputs should be serializable ([pickle](https://docs.python.org/3/library/pickle.html)-able). Here's a simple example: ```python @@ -62,4 +62,4 @@ async def example_step(): async with aiohttp.ClientSession() as session: async with session.get("https://example.com") as response: return await response.text() -``` \ No newline at end of file +``` From e1dfdc62f09059f7911c21d553199d9321329d59 Mon Sep 17 00:00:00 2001 From: Josh Kline <194861906+jkline-trustle@users.noreply.github.com> Date: Sun, 16 Feb 2025 09:02:53 -0800 Subject: [PATCH 2/2] Serializable input for steps called outside workflows Address the edge case of a `step` called outside a `workflow`. --- docs/python/tutorials/step-tutorial.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/python/tutorials/step-tutorial.md b/docs/python/tutorials/step-tutorial.md index 77b5aefc3..f1100f6e5 100644 --- a/docs/python/tutorials/step-tutorial.md +++ b/docs/python/tutorials/step-tutorial.md @@ -24,6 +24,8 @@ Therefore, making a function a step guarantees that a workflow will never re-exe 2. DBOS provides [configurable automatic retries](#configurable-retries) for steps to more easily handle transient errors. +(A `step` called from outside a `workflow` will be upgraded to `workflow` and +therefore the inputs must also be serializable.) ### Configurable Retries