From 986e1de079d82a7c274ce0113c387dd6e42bdea8 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Thu, 28 Nov 2024 15:40:55 +0200 Subject: [PATCH] docs: add note about retryInterval making workflow long-running --- .../workflows/long-running-workflow/page.mdx | 6 ++++++ .../workflows/retry-failed-steps/page.mdx | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx index 93fe67dce19ab..32f003cdff5a6 100644 --- a/www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx +++ b/www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx @@ -74,6 +74,12 @@ The second step has in its configuration object `async` set to `true` and it doe So, when you execute the `hello-world` workflow, it continues its execution in the background once it reaches the second step. + + +A workflow is also considered long-running if one of its steps has their `retryInterval` option set as explained in [this chapter](../retry-failed-steps/page.mdx). + + + --- ## Change Step Status diff --git a/www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx index 8e5f5643de5bb..5c19281510afc 100644 --- a/www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx +++ b/www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx @@ -64,9 +64,7 @@ The first line indicates the first time the step was executed, and the next two ## Step Retry Intervals -By default, a step is retried immediately after it fails. - -To specify a wait time before a step is retried, pass a `retryInterval` property to the step's configuration object. Its value is a number of seconds to wait before retrying the step. +By default, a step is retried immediately after it fails. To specify a wait time before a step is retried, pass a `retryInterval` property to the step's configuration object. Its value is a number of seconds to wait before retrying the step. For example: @@ -82,3 +80,9 @@ const step1 = createStep( } ) ``` + +### Interval Changes Workflow to Long-Running + +By setting `retryInterval` on a step, a workflow becomes a [long-running workflow](../long-running-workflow/page.mdx) that runs asynchronously in the background. So, you won't receive its result or errors immediately when you execute the workflow. + +Instead, you must subscribe to the workflow's execution using the Workflow Engine Module Service. Learn more about it in [this chapter](../long-running-workflow/page.mdx#access-long-running-workflow-status-and-result).