← Files CrowdStrike Falcon FusionARCHIVED FILE

skills/authoring/assets/loop-conditional.yaml

6.98 KB · Oct 2, 2026 · 00:31 UTC

↓ Download file

# Template: Loop with conditional branching (trigger → Loop → conditions → type-specific actions)
# Each condition routes to a different action, with type-specific UpdateVariable nodes.
#
# WARNING: This template uses PLACEHOLDER_ markers to show YAML structure only.
# Do NOT copy PLACEHOLDER_ values into your workflow YAML.
# - Action IDs: MUST be resolved via action_search.py BEFORE writing YAML
# - config_id: MUST be obtained from the user (CID-specific)
# - Names/labels/params: Choose your own descriptive values

name: 'PLACEHOLDER_WORKFLOW_NAME'
description: PLACEHOLDER_WORKFLOW_DESCRIPTION
trigger:
    next:
        - Loop
    name: On demand
    parameters:
        $schema: https://json-schema.org/draft-07/schema
        properties:
            PLACEHOLDER_ARRAY_PARAM:
                items:
                    properties:
                        item_type:
                            type: string
                            title: Item Type
                            description: 'Type of item (determines which action to run).'
                            enum:
                                - PLACEHOLDER_TYPE_A
                                - PLACEHOLDER_TYPE_B
                                - PLACEHOLDER_TYPE_C
                        item_value:
                            type: string
                            title: Item Value
                            description: The value to process.
                    required:
                        - item_type
                        - item_value
                    type: object
                type: array
                title: PLACEHOLDER_ARRAY_TITLE
                description: PLACEHOLDER_ARRAY_DESCRIPTION
                minItems: 1
        required:
            - PLACEHOLDER_ARRAY_PARAM
        type: object
    type: On demand
loops:
    Loop:
        display: For each PLACEHOLDER_ARRAY_TITLE; Sequentially
        name: For each PLACEHOLDER_ARRAY_TITLE; Sequentially
        for:
            input: PLACEHOLDER_ARRAY_PARAM
            continue_on_partial_execution: false
            sequential: true
        trigger:
            next:
                - CreateVariable
        actions:
            CreateVariable:
                id: 702d15788dbbffdf0b68d8e2f3599aa4
                class: CreateVariable
                name: Create variable
                next:
                    - is_type_a
                    - is_type_b
                    - is_type_c
                properties:
                    variable_schema:
                        properties:
                            item_type:
                                type: string
                            item_value:
                                type: string
                            result_count:
                                type: integer
                            result_items:
                                items:
                                    type: string
                                type: array
                        required:
                            - item_type
                            - item_value
                            - result_count
                        type: object
                version_constraint: ~1
            ActionTypeA:
                id: PLACEHOLDER_ACTION_A_ID
                name: PLACEHOLDER_ACTION_A_NAME
                next:
                    - UpdateVariableTypeA
                properties:
                    PLACEHOLDER_INPUT: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_value']}
                version_constraint: ~1
            ActionTypeB:
                id: PLACEHOLDER_ACTION_B_ID
                name: PLACEHOLDER_ACTION_B_NAME
                next:
                    - UpdateVariableTypeB
                properties:
                    PLACEHOLDER_INPUT: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_value']}
                version_constraint: ~1
            ActionTypeC:
                id: PLACEHOLDER_ACTION_C_ID
                name: PLACEHOLDER_ACTION_C_NAME
                next:
                    - UpdateVariableTypeC
                properties:
                    PLACEHOLDER_INPUT: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_value']}
                version_constraint: ~1
            UpdateVariableTypeA:
                id: 6c6eab39063fa3b72d98c82af60deb8a
                class: UpdateVariable
                name: Update variable - Type A
                properties:
                    WorkflowCustomVariable:
                        item_type: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_type']}
                        item_value: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_value']}
                        result_count: ${data['ActionTypeA.Count']}
                        result_items: ${data['ActionTypeA.PLACEHOLDER_RESULTS_FIELD'].map(item, item.ID)}
                version_constraint: ~1
            UpdateVariableTypeB:
                id: 6c6eab39063fa3b72d98c82af60deb8a
                class: UpdateVariable
                name: Update variable - Type B
                properties:
                    WorkflowCustomVariable:
                        item_type: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_type']}
                        item_value: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_value']}
                        result_count: ${data['ActionTypeB.Count']}
                        result_items: ${data['ActionTypeB.PLACEHOLDER_RESULTS_FIELD'].map(item, item.ID)}
                version_constraint: ~1
            UpdateVariableTypeC:
                id: 6c6eab39063fa3b72d98c82af60deb8a
                class: UpdateVariable
                name: Update variable - Type C
                properties:
                    WorkflowCustomVariable:
                        item_type: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_type']}
                        item_value: ${data['PLACEHOLDER_ARRAY_PARAM.#.item_value']}
                        result_count: ${data['ActionTypeC.Count']}
                        result_items: ${data['ActionTypeC.PLACEHOLDER_RESULTS_FIELD'].map(item, item.ID)}
                version_constraint: ~1
        conditions:
            is_type_a:
                next:
                    - ActionTypeA
                cel_expression: data['PLACEHOLDER_ARRAY_PARAM.#.item_type'] == 'PLACEHOLDER_TYPE_A'
                display:
                    - Item type is PLACEHOLDER_TYPE_A
            is_type_b:
                next:
                    - ActionTypeB
                cel_expression: data['PLACEHOLDER_ARRAY_PARAM.#.item_type'] == 'PLACEHOLDER_TYPE_B'
                display:
                    - Item type is PLACEHOLDER_TYPE_B
            is_type_c:
                next:
                    - ActionTypeC
                cel_expression: data['PLACEHOLDER_ARRAY_PARAM.#.item_type'] == 'PLACEHOLDER_TYPE_C'
                display:
                    - Item type is PLACEHOLDER_TYPE_C
        output_fields:
            - WorkflowCustomVariable.item_type
            - WorkflowCustomVariable.item_value
            - WorkflowCustomVariable.result_count
            - WorkflowCustomVariable.result_items
output_fields:
    - Loop.output

SHA-256: 74ffd4ca0630f2c35964c4d7a9aa11e7ccf21322a06bb999538fb9797427949e