Skip to main content

Create and test scenarios

Create scenario

In Monitoring Flow, you can create scenario steps (workflow) using scenarios. The steps to create a new scenario are as follows.

info

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

Create a scenario to run workflows in Monitoring Flow.

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

  2. Click the [Create scenario] button to proceed to the scenario creation screen.

  3. Enter the required information and click the [Create] button.

    • After selecting the flow connection, you can view the subnets connected to the flow connection. The connected subnet can be modified in the flow connection details.
    ItemDescription
    Scenario nameDuplicate scenario names cannot be used within the same project.
    Flow connectionOnly VPCs registered with the flow connection can be selected, and only one flow connection can be selected.
    - A single flow connection can have multiple scenarios.
    - To access internal resources within KakaoCloud, a flow connection must be selected, but scenarios can also be created without a flow connection.
    Connected subnetOnly subnets connected to the selected flow connection can be viewed.
    - To modify the connected subnet, refer to Manage subnet connections.
    ScheduleSet the schedule to run the scenario.
    - Schedule setting is required for proper scenario step operation.

Step-by-step scenario

A scenario can be completed by combining the five steps (API, Set Variables, For, If, Sleep). Scenario steps are workflows that compose the scenario, and scenarios must be saved to function properly.

Terminology
  • Step: The stages that make up a scenario, defined and combined to create various scenarios.
  • Scenario: A term in KakaoCloud that refers to workflows, where steps are automated according to a schedule for efficient monitoring.
  • Variable: A term referring to user-defined variables, which can be commonly accessed within workflows.

The types of scenario steps are as follows.

ItemDescription
APIStep to specify the API to call.
Set VariablesStep to set the values of variables.
- Variables can be commonly accessed during scenario execution.
- After creating a default variable, variables can be selected in the Set Variables step.
ForStep to set the repetition condition.
- Supports simple repetition and iteration over JSON lists, with a maximum of 1,000 repetitions.
- The marker represents the current position within the variable result.
IfStep to set conditions using comparison operators.
SleepStep to pause the process by setting a delay time.
- Can be set to a maximum of 5 minutes.

Add scenario steps

  1. Go to KakaoCloud Console > Management > Monitoring Flow > Scenario.
  2. Click the scenario name to go to the scenario details screen.
  3. Go to the Details tab, then click the [Add scenario step] button at the bottom.
  4. From the right panel of the scenario step editor, add scenario steps.
info
  • If any required fields are missing in a scenario step, a warning icon will appear next to the step.
  • Scenario steps cannot be saved if required fields are not entered. Be sure to fill in all required fields.
  • When configuring certain steps, a default variable must be registered in advance.

Manage default variable

You can change the number and information of default variables. Default variables must be registered before creating steps.

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

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

  3. Click the [Manage default variable] button in the top right to register default variables (up to 20).

  4. Enter key, type, and value, then save.

    ItemDescription
    KeyEnter the key value for the variable.
    TypeSelect the variable type.
    - Choose from String, Integer, JSON List, or JSON Map.
    ValueEnter the default value that matches the selected type.
caution

Default variables that contain data used in other steps cannot be modified or deleted. Be sure to delete the data from the relevant steps before attempting to edit the default variable.

Configure API step

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

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

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

  4. Enter the required information for the 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 of the URL.
    - If not entered, it will default to 200.
    MethodSelect the API request method.
    URLEnter the URL of the API to be accessed.
    - Variables can be used in the URL (e.g., ${IP} → 12.34.56.78, http://${IP} → http://12.34.56.78).
    ParametersEnter parameters.
    - Up to 10 parameters can be saved.
    KeyEnter the parameter key.
    - Duplicate keys cannot be saved.
    ValueEnter the parameter value.
    - Variables can be used in the value.
    HeadersEnter headers key/value.
    - Up to 10 parameters can be saved.
    KeyEnter the header key.
    - Duplicate keys cannot be saved.
    ValueEnter the header value.
    - Variables can be used in the value.
    BodyEnter the body value.
    - Variables can be used.
    - Refer to the body example below.
    {
    "name": "kakaocloud",
    "org": {
    "name": "kakaocloud"
    }
    }
  5. After entering all required fields, if additional steps are needed, click [Add next step] button on the left panel.

    • The API step can also be used alone.
    • Sub-steps cannot be added to the API step.
    • To delete the API step, ensure that no other step stores the API information. If other steps store information from the API you wish to delete, be sure to remove that information before deleting the API step.
    info

    The destination’s firewall must allow the following IP:

    • 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 New step settings on the right panel, 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 following parameter fields.
    - Up to 5 parameters can be saved.
    VariableSelect one from the list of Default Variables.
    - Variables already used in the step cannot be selected again.
    - If no variables are saved, add one in Default Variable.
    StepSelect one API step stored in the upper steps.
    - If no API steps exist, create one in Configure API step.
    Request/ResponseSelect either request or response.
    ComponentDepending on the request/response, select parameters, headers, or body.
    KeyEnter or select a value for the chosen request/response.
  4. Click the [Save] button.

Configure For step

info
  • The For step cannot have a next step.

  • The For step must have a sub-step.

  • If the For step is a sub-step, it cannot have a next step or sub-step.

    • (Example) If a For step is added as a sub-step of an If step, the If step cannot have a next/sub-step.
    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 New step settings on the right panel, 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 conditions based on the selected type.
    TypeSelect either count or foreach.
    CountEnter the number of repetitions, up to 1,000.
    - Enter the number of simple repetitions for the For step (1–1,000).
    ForeachSelect a Base Variable.
    - Choose a JSON List from Default Variables to iterate over multiple JSON list data.
    - Select one from the list of Default Variables.
    - Only JSON Lists can be selected.
    Continue on ErrorSet whether to continue execution if errors occur.
    - If set, the For step will continue running even if an error occurs.
    MarkerThe current position within the selected variable’s result. Markers allow reading data from the specified position.
    - Up to 5 marker values can be stored.
    Marker VariableSelect one from the list of Default Variables.
    - Variables already used can be selected again.
    Marker ValueEnter a value to read data from the specified position.
    - Must start with marker.
    info

    Marker values indicate the current position in the selected variable’s result, allowing data to be read from that point. Example:

    ItemExample
    Default Variable- key: name / type: string
    - key: age / type: integer
    Marker Variable- ${name}
    - ${age}
    Marker Value- marker.name
    - marker.age
    Result- ${name} = “kakao”, “john”
    - ${age} = 10, 20
  4. After entering all the required fields for the For step, click Add sub-step on the left panel to add a sub-step.

    • The For step cannot have a next step, and it 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 New step settings on the right panel, 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 condition based on the selected type.
    - If the condition is true, the If step executes its conditions in the given order.
    LogicalSelect either and or or.
    - This is available only when more than one condition is saved.
    Left OperandEnter the condition target for the operation.
    - Variables can be used.
    ComparisonSelect the comparison operator for the operand.
    Right OperandEnter the reference value.
    - Variables can be used.
  4. After entering all required fields for the If step, click [Add next step] or [Add sub-step] button on the left panel.
    - The If step must have a sub-step.

Configure Sleep step

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

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

  3. In New step settings on the right panel, 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 sleep time.
    - Maximum of 5 minutes.
  4. After entering all required fields for the Sleep step, click [Add next step] button or [Add sub step] button on the left panel.

Run scenario step test and check results

  1. After entering all required fields for the scenario step, click the [Test] button at the top right and check the test results.

    • The test results screen is the same as the actual scenario execution result.
    • If there are any errors in the steps, check the error details at the bottom of the right panel.
  2. After or before checking the test results, make sure to save the scenario.

    caution
    • If you do not save after testing, the previously created steps will be lost.
    • Unsaved scenario steps cannot be recovered.
  3. The saved scenario steps will be executed according to the schedule set in the scenario.

    • The scenario does not run immediately after saving, and it may take some time to execute.