diff --git a/en/guides/workflow/node/loop.md b/en/guides/workflow/node/loop.md
index d8deddee5..2f5b9aad0 100644
--- a/en/guides/workflow/node/loop.md
+++ b/en/guides/workflow/node/loop.md
@@ -28,7 +28,7 @@ A **Loop** node executes repetitive tasks that depend on previous iteration resu
-## Configuration
+## Configurations
@@ -49,35 +49,85 @@ A **Loop** node executes repetitive tasks that depend on previous iteration resu
Upper limit on iterations to prevent infinite loops
10, 100, 1000
+
+
Loop Variables
+
Values that persist across iterations and remain accessible to nodes after the loop completes
+
A counter x < 50 increases by 1 each iteration. Use it for calculations inside the loop, then access its final value in later workflow steps.
+
+
+
Exit Loop Node
+
Immediately ends the loop when reached
+
Caps execution at 10 iterations, regardless of other conditions.
+
-
+{% hint style="info" %}
+The loop can be terminated by either the **Exit Loop Node** or the **Loop Termination Condition**. When either condition is met, the loop will immediately exit.
-## Usage Example
+If no exit conditions are specified, the loop will continue executing (similar to `while (true)`) until it reaches the **Maximum Loop Count**.
+{% endhint %}
-**Goal: Generate random numbers (1-100) until a value below 50 appears.**
+## Example 1: Basic Loop
+
+**Goal: Generate random numbers between 1-100 until getting a number less than 50.**
**Steps**:
-1. Use `node` to generate a random number between 1-100.
+1. Set up a **Loop** node by configuring its **Loop Termination Condition** to trigger when the **Template** node returns `done`.
+
+2. Set up a **Code** node that generates random integers between `1` and `100`.
+
+3. Set up an **IF/ELSE** node with the following logic:
+
+ - For numbers ≥ 50: Output the `Current Number` and continue the loop
+
+ - For numbers < 50: Output the `Final Number`, and then use the **Template** node to return `done`
+
+4. The workflow terminates automatically once a number below `50` is generated.
+
+
+
+
+
+## Example 2: Advanced Loop (with Variables and Exit Node)
+
+**Goal: Design a workflow that generates a poem through four iterative refinements, with each version building upon the previous one.**
+
+**Steps:**
+
+1. Set up a **Loop** node with those **Loop Variables**:
+
+ - num: A counter starting at 0, incrementing by 1 per iteration
+
+ - verse: A text variable initialized with `I haven't started creating yet`
+
+2. Set up an **IF/ELSE** node that evaluates the iteration count:
-2. Use `if` to evaluate the number:
+ - When num > 3: Proceed the **Exit Loop** node
+
+ - When num ≤ 3: Proceed to the **LLM** node
- - If < 50: Output `done` and terminate loop.
+3. Set up an **LLM** node to generate poems.
- - If ≥ 50: Continue loop and generate another random number.
+{% hint style="info" %}
+Example Prompt:
-3. Set the exit criterion to random_number < 50.
+You are a European literary figure who can create poetic verses based on `sys.query`.
-4. Loop ends when a number below 50 appears.
+`verse` is your last creation. You can progress based on your previous work.
+{% endhint %}
-
+The first iteration begins with the initial verse value `I haven't started creating yet`. Each subsequent iteration builds upon the previous output, with the new poem replacing the verse variable’s content.
-## Planned Enhancements
+4. Set up a **Variable Assigner** node to manage state:
-**Future releases will include:**
+ - Increment num by 1 after each iteration
+
+ - Update verse with the newly generated poem
- - Loop variables: Store and reference values across iterations for improved state management and conditional logic.
+5. When executed, the workflow will produce four versions of your poem, each iteration building upon its previous output.
- - `break` node: Terminate loops from within the execution path, enabling more sophisticated control flow patterns.
+
\ No newline at end of file
diff --git a/en/guides/workflow/node/variable-assigner.md b/en/guides/workflow/node/variable-assigner.md
index a1ab23795..7b4e8036c 100644
--- a/en/guides/workflow/node/variable-assigner.md
+++ b/en/guides/workflow/node/variable-assigner.md
@@ -4,7 +4,9 @@
The variable assigner node is used to assign values to writable variables. Currently supported writable variables include:
-* [conversation variables](https://docs.dify.ai/guides/workflow/key-concepts#conversation-variables).
+* [Conversation variables](https://docs.dify.ai/guides/workflow/key-concepts#conversation-variables).
+
+* [Loop variables](https://docs.dify.ai/guides/workflow/node/loop).
Usage: Through the variable assigner node, you can assign workflow variables to conversation variables for temporary storage, which can be continuously referenced in subsequent conversations.
diff --git a/jp/guides/workflow/node/loop.md b/jp/guides/workflow/node/loop.md
index d5a569951..f89fd9429 100644
--- a/jp/guides/workflow/node/loop.md
+++ b/jp/guides/workflow/node/loop.md
@@ -18,7 +18,7 @@
繰り返し処理(ループ)
各回の処理が前回の結果に依存する。
-
再帰処理や最適化問題など、前回の計算結果を必要とする処理に適している。
+
前回の計算結果を必要とする処理に適している。
反復処理(イテレーション)
@@ -45,37 +45,91 @@
x < 50、error_rate < 0.01
-
最大繰り返し回数(Maximum Loop Count)
+
最大繰り返し回数
無限ループを防ぐための繰り返し回数の上限
10、100、1000
+
+
ループ変数
+
反復ごとにデータが受け渡され、ループ終了後も後続ノードで利用可能です。
+
変数 x < 50 はループごとに1ずつ増加し、ループ内では x < 50 の値に基づいて計算を実行できます。ループ終了後、x < 50 の最終値は後続の処理で利用可能です。