Skip to main content

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.

info

Once a scenario is created, the connected flow connection cannot be modified.

You create a scenario to operate a workflow in Monitoring Flow.

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click the [Create scenario] button to open the scenario creation page.

  3. 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.
    ItemDescription
    Scenario nameScenario names must be unique within the same project.
    Flow connectionOnly 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.
    SubnetOnly subnets connected to the selected flow connection are shown.
    - To modify, see Manage subnet connections.
    ScheduleSet 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.

Terminology
  • 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 typeDescription
APIDefines an API to call.
Set VariablesSets values to predefined variables.
- Register default variables first.
ForRepeats a process with a count or JSON list (max 1,000).
- Uses markers to track position.
IfAdds conditional logic using comparison operators.
SleepPauses execution for up to 5 minutes.

Add scenario steps

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
  2. Click a scenario name to open its detail page.
  3. Go to the Details tab and click [Add scenario step].
  4. Add and configure steps using the panel on the right.
info
  • 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.

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click Scenario > [More] > Edit scenario step.

  3. At the top right, click the [Manage default variable] button to register default variables (up to 20).

  4. Enter the Key, Type, and Value, then click Save.

    ItemDescription
    KeyEnter the key value of the variable
    TypeSelect the variable type
    - Choose from String, Integer, JSON List, or JSON Map
    ValueEnter the default value corresponding to the selected type
caution

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

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click Scenario > [More] > Edit scenario step.

  3. In the New step settings panel on the right, select API as the step type.

  4. Enter the required information for API configuration.

    ItemCategoryDescription
    TypeSelect API.
    Step nameEnter a name for the step.
    - Duplicate names cannot be used within the same scenario.
    Expected codeEnter the expected status code for the URL.
    - If omitted, it defaults to 200.
    MethodSelect the HTTP method for the API request.
    URLEnter 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).
    ParametersEnter parameter information.
    - Up to 10 parameters can be saved.
    KeyEnter the parameter key.
    - Duplicate keys cannot be saved.
    ValueEnter the parameter value.
    - Variables can be used.
    HeadersEnter header key/value pairs.
    - Up to 10 parameters can be saved.
    KeyEnter the header key.
    - Duplicate keys cannot be saved.
    ValueEnter the header value.
    - Variables can be used.
    BodyEnter the body content.
    - Variables can be used.
    - See the example below.
    Body example
    {
    "name": "kakaocloud",
    "org": {
    "name": "kakaocloud"
    }
    }
  5. 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.
info

Allow the following IP in the destination’s firewall:

  • IP 61.109.236.21

Configure Set Variables step

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click Scenario > [More] > Edit scenario step.

  3. In the New step settings panel on the right, select Set Variables as the step type and configure the following fields.

    ItemCategoryDescription
    TypeSelect Set Variables.
    Step nameEnter a name for the step.
    - Duplicate names cannot be used within the same scenario.
    ParametersEnter the parameter fields below.
    - Up to 5 parameters can be saved.
    VariableSelect 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.
    StepSelect an API step from the upper steps.
    - If no API step exists, create one via Configure API step.
    Request/ResponseSelect either request or response.
    ComponentDepending on the selected type, choose parameters, headers, or body.
    KeyEnter or select the key from the request/response result.
  4. Click the Save button.


Configure For step

info
  • 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 additional sub-steps.
1 Depth2 Depth3 Depth
API
If
For
Next step for If not allowedSub-step for If not allowedAPI
  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click Scenario > [More] > Edit scenario step.

  3. In the New step settings panel on the right, select For as the step type and configure the following fields.

    ItemCategoryDescription
    TypeSelect For.
    Step nameEnter a name for the step.
    - Duplicate names cannot be used within the same scenario.
    ConditionEnter a condition appropriate for the type.
    TypeSelect either count or foreach.
    CountEnter the number of repetitions (1–1,000).
    ForeachSelect a Base Variable from registered JSON Lists.
    - Only JSON List types can be selected.
    Continue on ErrorSpecify whether to continue if an error occurs.
    - If enabled, the loop continues even if an error is encountered.
    MarkerUse markers to read data at the current position in the loop.
    - Up to 5 marker values can be saved.
    Marker VariableSelect one Default Variable.
    Marker ValueEnter a key path to read the current value (must start with marker).
info

Marker values refer to positions within the looped variable. Example:

ItemExample
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
  1. 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

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click Scenario > [More] > Edit scenario step.

  3. In the New step settings panel on the right, select If as the step type and configure the following fields.

    ItemCategoryDescription
    TypeSelect If.
    Step nameEnter a name for the step.
    - Duplicate names cannot be used within the same scenario.
    ConditionEnter the conditional expression.
    - If the condition is true, the If step runs in order.
    LogicalSelect and or or.
    - Required if two or more conditions are saved.
    Left OperandEnter the target of comparison.
    - Variables can be used.
    ComparisonSelect a comparison operator.
    Right OperandEnter the comparison value.
    - Variables can be used.
  4. After completing all required fields, click Add next step or Add sub-step.

    • The If step must include a sub-step.

Configure Sleep step

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.

  2. Click Scenario > [More] > Edit scenario step.

  3. In the New step settings panel on the right, select Sleep as the step type and configure the following fields.

    ItemDescription
    TypeSelect Sleep.
    Step nameEnter a name for the step.
    - Duplicate names cannot be used within the same scenario.
    Sleep timeEnter the duration (max 5 minutes).
  4. After entering all required fields, click Add next step or Add sub-step.


Run scenario step test and check results

  1. 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.
  2. Make sure to save the scenario before or after the test.

caution
  • If you do not save after testing, any unsaved steps will be lost.
  • Unsaved steps cannot be recovered.
  1. Saved scenario steps are executed according to the defined schedule.
    • Scenarios are not executed immediately after saving and may take some time to start.