Create and test scenarios
Create scenario
In Monitoring Flow, you can create workflows by combining scenario steps. The following explains how to create a new scenario.
Once a scenario is created, the connected flow connection cannot be modified.
You create a scenario to operate a workflow in Monitoring Flow.
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click the [Create scenario] button to open the scenario creation page.
-
Enter the required information and click [Create].
- After selecting a flow connection, you can view subnets linked to it. Subnets can be managed on the flow connection detail page.
Item Description Scenario name Scenario names must be unique within the same project. Flow connection Only one flow connection can be selected.
- A flow connection can be linked to multiple scenarios.
- To access internal KakaoCloud resources, select a flow connection. You can also create scenarios without one.Subnet Only subnets connected to the selected flow connection are shown.
- To modify, see Manage subnet connections.Schedule Set a schedule to run the scenario.
- Required for proper step execution.
Scenario step types
A scenario consists of up to five step types (API, Set Variables, For, If, Sleep). Steps define the workflow and must be saved to function properly.
- Step: A defined unit used to build a scenario workflow.
- Scenario: A workflow in KakaoCloud that automates monitoring tasks using scheduled steps.
- Variable: A user-defined value accessible across steps.
Step type | Description |
---|---|
API | Defines an API to call. |
Set Variables | Sets values to predefined variables. - Register default variables first. |
For | Repeats a process with a count or JSON list (max 1,000). - Uses markers to track position. |
If | Adds conditional logic using comparison operators. |
Sleep | Pauses execution for up to 5 minutes. |
Add scenario steps
- Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
- Click a scenario name to open its detail page.
- Go to the Details tab and click [Add scenario step].
- Add and configure steps using the panel on the right.
- A warning icon appears if any required field is missing.
- Steps cannot be saved without completing required fields.
- Some steps require default variables in advance.
Manage default variables
You can modify the number and details of default variables. Before creating steps, you must register default variables first.
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click Scenario > [More] > Edit scenario step.
-
At the top right, click the [Manage default variable] button to register default variables (up to 20).
-
Enter the Key, Type, and Value, then click Save.
Item Description Key Enter the key value of the variable Type Select the variable type
- Choose from String, Integer, JSON List, or JSON MapValue Enter the default value corresponding to the selected type
Default variables that are used in other steps cannot be edited or deleted. Make sure to remove the variable from the relevant steps before modifying it.
Configure API step
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click Scenario > [More] > Edit scenario step.
-
In the New step settings panel on the right, select
API
as the step type. -
Enter the required information for API configuration.
Item Category Description Type Select API
.Step name Enter a name for the step.
- Duplicate names cannot be used within the same scenario.Expected code Enter the expected status code for the URL.
- If omitted, it defaults to200
.Method Select the HTTP method for the API request. URL Enter the URL to access the API.
- Variables can be used in the URL (e.g.,${IP}
→ 12.34.56.78, http://${IP}
→ http://12.34.56.78
).Parameters Enter parameter information.
- Up to 10 parameters can be saved.Key Enter the parameter key.
- Duplicate keys cannot be saved.Value Enter the parameter value.
- Variables can be used.Headers Enter header key/value pairs.
- Up to 10 parameters can be saved.Key Enter the header key.
- Duplicate keys cannot be saved.Value Enter the header value.
- Variables can be used.Body Enter the body content.
- Variables can be used.
- See the example below.Body example{
"name": "kakaocloud",
"org": {
"name": "kakaocloud"
}
} -
After entering all required fields, click Add next step on the left panel if you want to add more steps.
- API steps can be used as standalone steps.
- Sub-steps cannot be added under API steps.
- To delete an API step, ensure that no other step is using information from it. If other steps are referencing the API, remove those references first.
Allow the following IP in the destination’s firewall:
- IP 61.109.236.21
Configure Set Variables step
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click Scenario > [More] > Edit scenario step.
-
In the New step settings panel on the right, select
Set Variables
as the step type and configure the following fields.Item Category Description Type Select Set Variables
.Step name Enter a name for the step.
- Duplicate names cannot be used within the same scenario.Parameters Enter the parameter fields below.
- Up to 5 parameters can be saved.Variable Select one from the list of registered Default Variables.
- Variables already used in this step cannot be selected again.
- If no variable is registered, add one via Manage default variables.Step Select an API step from the upper steps.
- If no API step exists, create one via Configure API step.Request/Response Select either request
orresponse
.Component Depending on the selected type, choose parameters
,headers
, orbody
.Key Enter or select the key from the request/response result. -
Click the Save button.
Configure For step
- For steps cannot have a
next step
. - For steps must have at least one
sub-step
. - If a For step is added as a sub-step, it cannot have a
next step
or additionalsub-steps
.
1 Depth | 2 Depth | 3 Depth |
---|---|---|
API | ||
If | ||
For | ||
Next step for If not allowed | Sub-step for If not allowed | API |
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click Scenario > [More] > Edit scenario step.
-
In the New step settings panel on the right, select
For
as the step type and configure the following fields.Item Category Description Type Select For
.Step name Enter a name for the step.
- Duplicate names cannot be used within the same scenario.Condition Enter a condition appropriate for the type. Type Select either count
orforeach
.Count Enter the number of repetitions (1–1,000). Foreach Select a Base Variable from registered JSON Lists.
- Only JSON List types can be selected.Continue on Error Specify whether to continue if an error occurs.
- If enabled, the loop continues even if an error is encountered.Marker Use markers to read data at the current position in the loop.
- Up to 5 marker values can be saved.Marker Variable Select one Default Variable. Marker Value Enter a key path to read the current value (must start with marker
).
Marker values refer to positions within the looped variable. Example:
Item | Example |
---|---|
Default Variable | - key: name (string) - key: age (integer) |
Marker Variable | - ${name} - ${age} |
Marker Value | - marker.name - marker.age |
Output Result | - ${name} = "kakao", "john"- ${age} = 10, 20 |
- After entering all required fields, click Add sub-step in the left panel to add a sub-step.
- For steps cannot have a next step and must have a sub-step.
Configure If step
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click Scenario > [More] > Edit scenario step.
-
In the New step settings panel on the right, select
If
as the step type and configure the following fields.Item Category Description Type Select If
.Step name Enter a name for the step.
- Duplicate names cannot be used within the same scenario.Condition Enter the conditional expression.
- If the condition is true, the If step runs in order.Logical Select and
oror
.
- Required if two or more conditions are saved.Left Operand Enter the target of comparison.
- Variables can be used.Comparison Select a comparison operator. Right Operand Enter the comparison value.
- Variables can be used. -
After completing all required fields, click Add next step or Add sub-step.
- The If step must include a sub-step.
Configure Sleep step
-
Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
-
Click Scenario > [More] > Edit scenario step.
-
In the New step settings panel on the right, select
Sleep
as the step type and configure the following fields.Item Description Type Select Sleep
.Step name Enter a name for the step.
- Duplicate names cannot be used within the same scenario.Sleep time Enter the duration (max 5 minutes). -
After entering all required fields, click Add next step or Add sub-step.
Run scenario step test and check results
-
After filling in all required fields for the step, click the Test button at the top right to run the test and view the result.
- The test output will reflect the actual execution result.
- If an error occurs in any step, view detailed error messages in the bottom right panel.
-
Make sure to save the scenario before or after the test.
- If you do not save after testing, any unsaved steps will be lost.
- Unsaved steps cannot be recovered.
- Saved scenario steps are executed according to the defined schedule.
- Scenarios are not executed immediately after saving and may take some time to start.
Explore use cases of Monitoring Flow in Tutorials: