LoopStep
Execute Iteration Step
Security Level 1 (Enabled)
Description
Executes a single iteration step of a loop previously initialized with LoopStart. Updates the iterator and the variables and returns the current status. Called repeatedly until the loop is complete.
JSON Parameters
{
"loopId": "calc_001",
"operations": [
{"var": "sum", "op": "add", "value": "i"},
{"var": "square", "op": "set", "value": "i^2"}
]
}
| Parameter | Type | Required | Description |
|---|---|---|---|
loopId | String | Yes | The loop identifier from LoopStart |
operations | Array | No | Operations for this iteration |
operations[].var | String | Yes | Target variable |
operations[].op | String | Yes | Operation: add, sub, mul, div, set |
operations[].value | String/Number | Yes | Value or formula ("i" for the iterator) |
Example Usage
API call:
POST /api/v1/tools/loopstep
Content-Type: application/json
{
"loopId": "sum_calc",
"operations": [
{"var": "total", "op": "add", "value": "i"}
]
}
Examples
Simple sum step:
{
"loopId": "sum_calc",
"operations": [
{"var": "total", "op": "add", "value": "i"}
]
}
Multiple operations:
{
"loopId": "complex_calc",
"operations": [
{"var": "sum", "op": "add", "value": "i"},
{"var": "sumSq", "op": "add", "value": "i^2"},
{"var": "product", "op": "mul", "value": "i"}
]
}
Statistical calculation:
{
"loopId": "stats_loop",
"operations": [
{"var": "count", "op": "add", "value": 1},
{"var": "sumX", "op": "add", "value": "i"},
{"var": "sumX2", "op": "add", "value": "i^2"}
]
}
Return Values
{
"loopId": "calc_001",
"status": "running",
"current": 5,
"remaining": 95,
"variables": {
"sum": 15,
"square": 25
},
"completed": false,
"success": true
}
| Field | Type | Description |
|---|---|---|
loopId | String | The loop identifier |
status | String | Current status |
current | Number | Current iterator value |
remaining | Number | Remaining iterations |
variables | Object | Current variable values |
completed | Boolean | True if the loop is complete |
success | Boolean | True if successful |
Related Tools
Why This Tool Stands Out
- Step-by-Step Control Control each iteration individually - debugging and monitoring in real time!
- Multiple Operations Any number of calculations per step - complex updates in a single call!
- Transparency Status and progress always visible - no more working in the dark!
- Chainable Perfect for sequential workflows - each step builds on the previous one!
Perfect for:
- Developers Algorithm debugging
- Simulation Experts Step by step
- Teachers Demonstrating iterative processes
Time Savings
No measured time-saving or performance figures are available here. Results depend on the task and environment.
Ready to Get Started?
Control your iterations step by step with LoopStep.
Download Now