create-triggered-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate Triggered Task Test Case Guide
触发任务测试用例创建指南
Usage Examples
使用示例
| What You Want | Example Prompt |
|---|---|
| Create triggered task | |
| Create and execute task | |
| Execute existing task | |
| Task with parameters | |
| Task with notifications | |
| Task with timeout | |
| Get template | |
| See example | |
| 你想要实现的操作 | 示例提示词 |
|---|---|
| 创建触发任务 | |
| 创建并执行任务 | |
| 执行现有任务 | |
| 带参数的任务 | |
| 带通知的任务 | |
| 带超时的任务 | |
| 获取模板 | |
| 查看示例 | |
Claude Instructions
Claude使用说明
IMPORTANT: When user asks a simple question like "How do I create a triggered task?", provide a concise answer first with just the template/command, then offer to explain more if needed. Do NOT dump all documentation.
PREREQUISITES (Claude: Always verify these before creating test cases):
- Pipeline must be imported first — use if not done yet.
/import-pipeline - Required accounts must be created first — use if not done yet.
/create-account - Know what parameters the pipeline expects (account references, schema, table, etc.).
MANDATORY: When creating triggered task test cases, you MUST call the Write tool to create ALL required files. Do NOT read files to check if they exist first. Do NOT say "file already exists" or "already complete". Always write them fresh:
- Robot test file () in
.robot— WRITE thistest/suite/pipeline_tests/[type]/ - TRIGGERED_TASK_README.md with file structure tree diagram in the same test directory — WRITE this
This applies to ALL triggered task test cases. No exceptions. You must call Write for each file. See the "IMPORTANT: Step-by-Step Workflow" section for details.
Response format for simple questions:
- Give the direct template or test case first
- Add a brief note if relevant
- Offer "Want me to explain more?" only if appropriate
重要提示: 当用户提出类似“如何创建触发任务?”的简单问题时,先提供简洁的答案,仅包含模板/命令,然后询问用户是否需要更多解释。不要直接输出所有文档内容。
前提条件(Claude:创建测试用例前务必验证以下内容):
- 必须先导入管道——若未完成,请使用命令。
/import-pipeline - 必须先创建所需账户——若未完成,请使用命令。
/create-account - 了解管道所需的参数(账户引用、模式、表等)。
强制要求: 创建触发任务测试用例时,必须调用Write工具来创建所有必要文件。无需先读取文件检查是否已存在,不要提示“文件已存在”或“已完成”,始终重新创建:
- Robot测试文件(格式),存放路径为
.robot——必须创建test/suite/pipeline_tests/[type]/ - TRIGGERED_TASK_README.md,包含文件结构树状图,存放在同一测试目录下——必须创建
此要求适用于所有触发任务测试用例,无例外情况。必须为每个文件调用Write工具。详细步骤请查看“重要提示:分步工作流”部分。
简单问题的回复格式:
- 先提供直接的模板或测试用例
- 如有需要,添加简短说明
- 仅在合适的情况下询问“需要我进一步解释吗?”
WHEN USER INVOKES /create-triggered-task
WITH NO ARGUMENTS
/create-triggered-task当用户仅调用/create-triggered-task
且无参数时
/create-triggered-taskClaude: When user types just with no specific request, present the menu below. Use this EXACT format:
/create-triggered-taskSnapLogic Triggered Task Creation & Execution
Prerequisites
- Pipeline must be imported first — use
/import-pipeline - Required accounts must be created first — use
/create-account - Know what parameters the pipeline expects
What I Can Do
For every triggered task, I create the complete set of files you need:
- Robot test file () — Robot Framework test cases for creating AND executing triggered tasks
.robot - TRIGGERED_TASK_README.md — File structure diagram, prerequisites, and run instructions
Two Key Operations:
- Create Triggered Task — Uses to create the task
Create Triggered Task From Template - Execute Triggered Task — Uses to run the task
Run Triggered Task With Parameters From Template
I can also:
- Show you how to pass pipeline parameters
- Configure email notifications for task completion/failure
- Set execution timeouts
- Override parameters at execution time
What is a Triggered Task?
A triggered task is an on-demand pipeline execution in SnapLogic. You first CREATE the task (define it), then EXECUTE it (run it with parameters).
Try these sample prompts to get started:
| Sample Prompt | What It Does |
|---|---|
| Creates triggered task test case |
| Creates task + runs it |
| Shows parameter override at execution |
| Shows parameter passing |
| Adds notification configuration |
| Displays existing reference test |
Need to set up the pipeline first? Use for complete setup.
/end-to-end-pipeline-verificationClaude:当用户仅输入而无具体请求时,展示以下菜单,必须严格遵循此格式:
/create-triggered-taskSnapLogic触发任务创建与执行
前提条件
- 必须先导入管道——使用命令
/import-pipeline - 必须先创建所需账户——使用命令
/create-account - 了解管道所需的参数
我能提供的功能
针对每个触发任务,我会创建你所需的完整文件集:
- Robot测试文件(格式)——用于创建和执行触发任务的Robot Framework测试用例
.robot - TRIGGERED_TASK_README.md——包含文件结构示意图、前提条件和运行说明
两项核心操作:
- 创建触发任务——使用来创建任务
Create Triggered Task From Template - 执行触发任务——使用来运行任务
Run Triggered Task With Parameters From Template
我还可以:
- 展示如何传递管道参数
- 配置任务完成/失败时的邮件通知
- 设置执行超时时间
- 执行时覆盖参数
什么是触发任务?
触发任务是SnapLogic中的按需管道执行功能。你需要先创建任务(定义任务),然后执行任务(带参数运行)。
尝试以下示例提示词开始操作:
| 示例提示词 | 功能说明 |
|---|---|
| 创建触发任务测试用例 |
| 创建并运行任务 |
| 展示执行时的参数覆盖 |
| 展示参数传递 |
| 添加通知配置 |
| 显示现有参考测试用例 |
需要先设置管道? 使用命令完成完整设置。
/end-to-end-pipeline-verificationNatural Language — Just Describe What You Need
自然语言交互——只需描述你的需求
You don't need special syntax. Just describe what you need after :
/create-triggered-task/create-triggered-task Create a triggered task for my Snowflake pipeline/create-triggered-task Create and execute a triggered task with input file parameter/create-triggered-task I need a task that passes snowflake_acct and schema parameters/create-triggered-task Execute a triggered task with different input files/create-triggered-task Create a task with email notifications on completion and failureBaseline test references:
test/suite/pipeline_tests/snowflake/snowflake_baseline_tests.robottest/suite/pipeline_tests/oracle/oracle_baseline_tests.robot
你无需使用特殊语法,在后直接描述需求即可:
/create-triggered-task/create-triggered-task Create a triggered task for my Snowflake pipeline/create-triggered-task Create and execute a triggered task with input file parameter/create-triggered-task I need a task that passes snowflake_acct and schema parameters/create-triggered-task Execute a triggered task with different input files/create-triggered-task Create a task with email notifications on completion and failure基准测试参考:
test/suite/pipeline_tests/snowflake/snowflake_baseline_tests.robottest/suite/pipeline_tests/oracle/oracle_baseline_tests.robot
Quick Template Reference
快速模板参考
Create triggered task:
robotframework
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300Execute triggered task:
robotframework
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} param1=value1 param2=value2Required variables for Create:
| Variable | Description |
|---|---|
| Generated in suite setup |
| SnapLogic path where pipeline is stored |
| Name of the pipeline |
| Name to assign to the task |
| Snaplex where task will execute (optional) |
| Dictionary of parameters to pass (optional) |
Required variables for Execute:
| Variable | Description |
|---|---|
| Same unique_id used when creating the task |
| SnapLogic path where pipeline is stored |
| Name of the pipeline |
| Name of the triggered task to execute |
| Optional parameter overrides |
Related slash command:
/create-triggered-task创建触发任务:
robotframework
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300执行触发任务:
robotframework
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} param1=value1 param2=value2创建任务所需变量:
| 变量 | 说明 |
|---|---|
| 在套件初始化时生成 |
| 管道在SnapLogic中的存储路径 |
| 管道名称 |
| 要分配给任务的名称 |
| 任务将在其中执行的Snaplex(可选) |
| 要传递的参数字典(可选) |
执行任务所需变量:
| 变量 | 说明 |
|---|---|
| 创建任务时使用的同一唯一ID |
| 管道在SnapLogic中的存储路径 |
| 管道名称 |
| 要执行的触发任务名称 |
| 可选的参数覆盖 |
相关斜杠命令:
/create-triggered-taskQuick Start Template
快速入门模板
Here's a basic test case template for creating AND executing triggered tasks:
IMPORTANT: Required Libraries When creating any new Robot file, ALWAYS include these Resource imports under:*** Settings ***
- SnapLogic API keywords from installed packagesnaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource - Project-specific common keywords../../resources/common/general.resource
robotframework
*** Settings ***
Documentation Creates and executes triggered tasks for SnapLogic pipeline execution
Resource snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource ../../resources/common/general.resource
Library Collections
*** Variables ***以下是用于创建和执行触发任务的基础测试用例模板:
重要提示:所需库 创建任何新的Robot文件时,必须在下包含以下Resource导入:*** Settings ***
——来自已安装包的SnapLogic API关键字snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource ——项目特定的通用关键字../../resources/common/general.resource
robotframework
*** Settings ***
Documentation Creates and executes triggered tasks for SnapLogic pipeline execution
Resource snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource ../../resources/common/general.resource
Library Collections
*** Variables ***Pipeline configuration
Pipeline configuration
${pipeline_name} my_pipeline
${task_name} Task
${pipeline_name} my_pipeline
${task_name} Task
Input file for execution
Input file for execution
${input_file_name} test_input.json
${input_file_name} test_input.json
Task parameters - passed to pipeline during creation
Task parameters - passed to pipeline during creation
&{task_params_set}
... account_name=../shared/${ACCOUNT_NAME}
... schema=DEMO
... table=TEST_TABLE
*** Test Cases ***
Create Triggered Task
[Documentation] Creates a triggered task for pipeline execution.
... PREREQUISITES:
... - Pipeline must be imported first
... - Accounts must be created first
... - ${unique_id} - Generated from suite setup
...
... ARGUMENTS:
... - ${unique_id}: Unique test execution identifier
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored
... - ${pipeline_name}: Name of the pipeline
... - ${task_name}: Name for the triggered task
... - ${GROUNDPLEX_NAME}: Snaplex for execution (optional)
... - ${task_params_set}: Parameters to pass to pipeline (optional)
[Tags] task_creation triggered_task
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Triggered Task
[Documentation] Executes the triggered task with specified parameters and monitors completion.
... This test case runs the pipeline through the triggered task, optionally overriding
... task parameters for different execution scenarios.
...
... PREREQUISITES:
... - Task must be created first (Create Triggered Task test case)
... - Task must be in ready state before execution
...
... ARGUMENTS:
... - ${unique_id}: Unique identifier matching the task creation
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored
... - ${pipeline_name}: Name of the pipeline associated with the task
... - ${task_name}: Name of the triggered task to execute
... - key=value: Optional parameter overrides (e.g., test_input_file=input.json)
[Tags] task_execution triggered_task
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file_name}
---&{task_params_set}
... account_name=../shared/${ACCOUNT_NAME}
... schema=DEMO
... table=TEST_TABLE
*** Test Cases ***
Create Triggered Task
[Documentation] Creates a triggered task for pipeline execution.
... PREREQUISITES:
... - Pipeline must be imported first
... - Accounts must be created first
... - ${unique_id} - Generated from suite setup
...
... ARGUMENTS:
... - ${unique_id}: Unique test execution identifier
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored
... - ${pipeline_name}: Name of the pipeline
... - ${task_name}: Name for the triggered task
... - ${GROUNDPLEX_NAME}: Snaplex for execution (optional)
... - ${task_params_set}: Parameters to pass to pipeline (optional)
[Tags] task_creation triggered_task
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Triggered Task
[Documentation] Executes the triggered task with specified parameters and monitors completion.
... This test case runs the pipeline through the triggered task, optionally overriding
... task parameters for different execution scenarios.
...
... PREREQUISITES:
... - Task must be created first (Create Triggered Task test case)
... - Task must be in ready state before execution
...
... ARGUMENTS:
... - ${unique_id}: Unique identifier matching the task creation
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored
... - ${pipeline_name}: Name of the pipeline associated with the task
... - ${task_name}: Name of the triggered task to execute
... - key=value: Optional parameter overrides (e.g., test_input_file=input.json)
[Tags] task_execution triggered_task
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file_name}
---IMPORTANT: Step-by-Step Workflow
重要提示:分步工作流
Always follow this workflow when creating triggered task test cases.
MANDATORY: You MUST create ALL of the following files:
| # | File | Location | Purpose |
|---|---|---|---|
| 1 | Robot test file | | Robot Framework test case |
| 2 | TRIGGERED_TASK_README.md | | File structure diagram and instructions |
ALWAYS create all files using the Write tool. There are NO exceptions. Even if a file already exists, you MUST still use the Write tool to create/overwrite it. Do NOT skip any file.
创建触发任务测试用例时,请始终遵循此工作流。
强制要求:必须创建以下所有文件:
| 序号 | 文件 | 路径 | 用途 |
|---|---|---|---|
| 1 | Robot测试文件 | | Robot Framework测试用例 |
| 2 | TRIGGERED_TASK_README.md | | 文件结构示意图和说明文档 |
必须始终使用Write工具创建所有文件。 无例外情况。即使文件已存在,也必须使用Write工具重新创建/覆盖,不得跳过任何文件。
Step 1: Identify Requirements
步骤1:明确需求
- Which pipeline is the triggered task for?
- What parameters does the pipeline need?
- Need notifications?
- What timeout value?
- Need to execute the task after creating it?
- 触发任务是为哪个管道创建的?
- 管道需要哪些参数?
- 是否需要通知?
- 超时值设为多少?
- 创建任务后是否需要执行?
Step 2: Verify Prerequisites
步骤2:验证前提条件
- Pipeline must be imported ()
/import-pipeline - Accounts must be created ()
/create-account
- 管道必须已导入(使用命令)
/import-pipeline - 账户必须已创建(使用命令)
/create-account
Step 3: Create the Robot Test Case (ALWAYS — use Write tool)
步骤3:创建Robot测试用例(必须执行——使用Write工具)
ALWAYS use the Write tool to create the test file. Do NOT skip this step.
.robot必须使用Write工具创建测试文件,不得跳过此步骤。
.robotStep 4: Create TRIGGERED_TASK_README.md (ALWAYS — use Write tool)
步骤4:创建TRIGGERED_TASK_README.md(必须执行——使用Write工具)
ALWAYS use the Write tool to create the README with file structure diagram. Do NOT skip this step.
必须使用Write工具创建包含文件结构示意图的README文档,不得跳过此步骤。
COMPLETE EXAMPLE: Snowflake Triggered Task with Execution (All Files)
完整示例:带执行功能的Snowflake触发任务(所有文件)
When a user asks "Create and execute a triggered task for Snowflake pipeline", you MUST create ALL of these files:
当用户请求“Create and execute a triggered task for Snowflake pipeline”时,必须创建以下所有文件:
File 1: Robot Test File — test/suite/pipeline_tests/snowflake/snowflake_triggered_task.robot
test/suite/pipeline_tests/snowflake/snowflake_triggered_task.robot文件1:Robot测试文件——test/suite/pipeline_tests/snowflake/snowflake_triggered_task.robot
test/suite/pipeline_tests/snowflake/snowflake_triggered_task.robotrobotframework
*** Settings ***
Documentation Creates and executes triggered task for Snowflake pipeline
... Task is created with parameters and then executed with optional overrides
Resource snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource ../../resources/common/general.resource
Library Collections
*** Variables ***robotframework
*** Settings ***
Documentation Creates and executes triggered task for Snowflake pipeline
... Task is created with parameters and then executed with optional overrides
Resource snaplogic_common_robot/snaplogic_apis_keywords/snaplogic_keywords.resource
Resource ../../resources/common/general.resource
Library Collections
*** Variables ***Pipeline configuration
Pipeline configuration
${pipeline_name} snowflake_keypair
${task_name} Task
${sf_acct_keypair} ${pipeline_name}_account
${pipeline_name} snowflake_keypair
${task_name} Task
${sf_acct_keypair} ${pipeline_name}_account
Input files for execution
Input files for execution
${input_file1_name} test_input_file1.json
${input_file2_name} test_input_file2.json
${input_file3_name} test_input_file3.json
${input_file1_name} test_input_file1.json
${input_file2_name} test_input_file2.json
${input_file3_name} test_input_file3.json
Notification configuration (optional)
Notification configuration (optional)
@{notification_states} Completed Failed
&{task_notifications}
... recipients=notify@example.com
... states=${notification_states}
@{notification_states} Completed Failed
&{task_notifications}
... recipients=notify@example.com
... states=${notification_states}
Task parameters - passed to pipeline during creation
Task parameters - passed to pipeline during creation
&{task_params_set}
... snowflake_acct=../shared/${sf_acct_keypair}
... schema=DEMO
... table=DEMO.TEST_TABLE
... isTest=test
... test_input_file=${input_file1_name}
*** Test Cases ***
Create Snowflake Triggered Task
[Documentation] Creates a triggered task for Snowflake pipeline execution.
... The task is configured with pipeline parameters for account reference,
... schema, and table settings.
...
... PREREQUISITES:
... - Snowflake account must be created first
... - Pipeline must be imported first
... - ${unique_id} - Generated from suite setup
...
... ARGUMENTS:
... - ${unique_id}: Unique test execution identifier
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored
... - ${pipeline_name}: Name of the pipeline (snowflake_keypair)
... - ${task_name}: Name for the triggered task (Task)
... - ${GROUNDPLEX_NAME}: Snaplex for execution
... - ${task_params_set}: Parameters including account, schema, table
... - execution_timeout: Task timeout in seconds
[Tags] snowflake task_creation triggered_task
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Snowflake Triggered Task
[Documentation] Executes the triggered task with specified parameters and monitors completion.
... This test case runs the pipeline through the triggered task, optionally overriding
... task parameters for different execution scenarios.
...
... PREREQUISITES:
... - Task must be created first (Create Snowflake Triggered Task)
... - Task must be in ready state before execution
...
... ARGUMENTS:
... - ${unique_id}: Unique identifier matching the task creation
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored
... - ${pipeline_name}: Name of the pipeline associated with the task
... - ${task_name}: Name of the triggered task to execute
... - test_input_file: Input file parameter override
[Tags] snowflake task_execution triggered_task
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file1_name}
# Additional executions with different input files (uncomment as needed):
# ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file2_name}
# ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file3_name}
undefined&{task_params_set}
... snowflake_acct=../shared/${sf_acct_keypair}
... schema=DEMO
... table=DEMO.TEST_TABLE
... isTest=test
... test_input_file=${input_file1_name}
*** Test Cases ***
Create Snowflake Triggered Task
[Documentation] Creates a triggered task for Snowflake pipeline execution.
... The task is configured with pipeline parameters for account reference,
... schema, and table settings.
...
... PREREQUISITES:
... - Snowflake account must be created first
... - Pipeline must be imported first
... - ${unique_id} - Generated from suite setup
...
... ARGUMENTS:
... - ${unique_id}: Unique test execution identifier
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipeline is stored
... - ${pipeline_name}: Name of the pipeline (snowflake_keypair)
... - ${task_name}: Name for the triggered task (Task)
... - ${GROUNDPLEX_NAME}: Snaplex for execution
... - ${task_params_set}: Parameters including account, schema, table
... - execution_timeout: Task timeout in seconds
[Tags] snowflake task_creation triggered_task
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} execution_timeout=300
Execute Snowflake Triggered Task
[Documentation] Executes the triggered task with specified parameters and monitors completion.
... This test case runs the pipeline through the triggered task, optionally overriding
... task parameters for different execution scenarios.
...
... PREREQUISITES:
... - Task must be created first (Create Snowflake Triggered Task)
... - Task must be in ready state before execution
...
... ARGUMENTS:
... - ${unique_id}: Unique identifier matching the task creation
... - ${PIPELINES_LOCATION_PATH}: SnapLogic path where pipelines are stored
... - ${pipeline_name}: Name of the pipeline associated with the task
... - ${task_name}: Name of the triggered task to execute
... - test_input_file: Input file parameter override
[Tags] snowflake task_execution triggered_task
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file1_name}
# Additional executions with different input files (uncomment as needed):
# ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file2_name}
# ${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file3_name}
undefinedFile 2: README — test/suite/pipeline_tests/snowflake/TRIGGERED_TASK_README.md
test/suite/pipeline_tests/snowflake/TRIGGERED_TASK_README.md文件2:README文档——test/suite/pipeline_tests/snowflake/TRIGGERED_TASK_README.md
test/suite/pipeline_tests/snowflake/TRIGGERED_TASK_README.mdmarkdown
undefinedmarkdown
undefinedSnowflake Triggered Task Tests
Snowflake Triggered Task Tests
This test suite creates AND executes triggered tasks for Snowflake pipeline testing.
This test suite creates AND executes triggered tasks for Snowflake pipeline testing.
Purpose
Purpose
Creates triggered task(s) for Snowflake pipeline execution with configurable parameters, then executes them with optional parameter overrides.
Creates triggered task(s) for Snowflake pipeline execution with configurable parameters, then executes them with optional parameter overrides.
Two Key Operations
Two Key Operations
| Operation | Keyword | Purpose |
|---|---|---|
| Create Task | | Defines the task with default parameters |
| Execute Task | | Runs the task, optionally overriding parameters |
| Operation | Keyword | Purpose |
|---|---|---|
| Create Task | | Defines the task with default parameters |
| Execute Task | | Runs the task, optionally overriding parameters |
File Structure
File Structure
project-root/
├── test/
│ └── suite/
│ └── pipeline_tests/
│ └── snowflake/
│ ├── snowflake_triggered_task.robot ← Test case file
│ └── TRIGGERED_TASK_README.md ← This file
└── .env ← Environment configurationproject-root/
├── test/
│ └── suite/
│ └── pipeline_tests/
│ └── snowflake/
│ ├── snowflake_triggered_task.robot ← Test case file
│ └── TRIGGERED_TASK_README.md ← This file
└── .env ← Environment configurationPrerequisites
Prerequisites
- Snowflake account must be created ()
/create-account - Pipeline must be imported ()
/import-pipeline - Environment variables configured in
.env
- Snowflake account must be created ()
/create-account - Pipeline must be imported ()
/import-pipeline - Environment variables configured in
.env
Task Parameters (Set at Creation)
Task Parameters (Set at Creation)
The following parameters are passed to the pipeline when the task is created:
- — Reference to the Snowflake account
snowflake_acct - — Database schema name
schema - — Target table name
table - — Test mode flag
isTest - — Default input file
test_input_file
The following parameters are passed to the pipeline when the task is created:
- — Reference to the Snowflake account
snowflake_acct - — Database schema name
schema - — Target table name
table - — Test mode flag
isTest - — Default input file
test_input_file
Parameter Overrides (At Execution)
Parameter Overrides (At Execution)
You can override parameters when executing the task:
robotframework
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=different_file.jsonYou can override parameters when executing the task:
robotframework
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=different_file.jsonHow to Run
How to Run
bash
undefinedbash
undefinedRun both create and execute
Run both create and execute
make robot-run-all-tests TAGS="snowflake AND triggered_task" PROJECT_SPACE_SETUP=True
make robot-run-all-tests TAGS="snowflake AND triggered_task" PROJECT_SPACE_SETUP=True
Run only task creation
Run only task creation
make robot-run-all-tests TAGS="task_creation" PROJECT_SPACE_SETUP=True
make robot-run-all-tests TAGS="task_creation" PROJECT_SPACE_SETUP=True
Run only task execution
Run only task execution
make robot-run-all-tests TAGS="task_execution" PROJECT_SPACE_SETUP=True
undefinedClaude: The above is a COMPLETE example. When creating triggered task test cases for ANY type, follow the same pattern — always create all files.
make robot-run-all-tests TAGS="task_execution" PROJECT_SPACE_SETUP=True
undefinedClaude:以上是完整示例。为任何类型的管道创建触发任务测试用例时,请遵循相同模式——始终创建所有文件。
Template Keyword Arguments
模板关键字参数
Create Triggered Task From Template
Create Triggered Task From Template
| Argument | Description | Required | Example |
|---|---|---|---|
| Unique test execution identifier | Yes | |
| SnapLogic path where pipeline is stored | Yes | |
| Name of the pipeline | Yes | |
| Name to assign to the task | Yes | |
| Snaplex where task will execute | Optional | |
| Dictionary of parameters | Optional | |
| Notification settings | Optional | |
| Timeout in seconds | Optional | |
| 参数 | 说明 | 是否必填 | 示例 |
|---|---|---|---|
| 唯一的测试执行标识符 | 是 | |
| 管道在SnapLogic中的存储路径 | 是 | |
| 管道名称 | 是 | |
| 要分配给任务的名称 | 是 | |
| 任务将在其中执行的Snaplex | 可选 | |
| 参数字典 | 可选 | |
| 通知设置 | 可选 | |
| 超时时间(秒) | 可选 | |
Run Triggered Task With Parameters From Template
Run Triggered Task With Parameters From Template
| Argument | Description | Required | Example |
|---|---|---|---|
| Unique test execution identifier | Yes | |
| SnapLogic path where pipeline is stored | Yes | |
| Name of the pipeline | Yes | |
| Name of the task to execute | Yes | |
| Parameter overrides | Optional | |
| 参数 | 说明 | 是否必填 | 示例 |
|---|---|---|---|
| 唯一的测试执行标识符 | 是 | |
| 管道在SnapLogic中的存储路径 | 是 | |
| 管道名称 | 是 | |
| 要执行的任务名称 | 是 | |
| 参数覆盖 | 可选 | |
Test Case Examples
测试用例示例
Basic Create and Execute
基础创建与执行
robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
${input_file_name} test_input.json
*** Test Cases ***
Create Triggered Task
[Documentation] Creates a triggered task.
[Tags] snowflake task_creation
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name}
Execute Triggered Task
[Documentation] Executes the triggered task.
[Tags] snowflake task_execution
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file_name}robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
${input_file_name} test_input.json
*** Test Cases ***
Create Triggered Task
[Documentation] Creates a triggered task.
[Tags] snowflake task_creation
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name}
Execute Triggered Task
[Documentation] Executes the triggered task.
[Tags] snowflake task_execution
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file_name}Execute with Multiple Input Files
多输入文件执行
robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
${input_file1_name} test_input_file1.json
${input_file2_name} test_input_file2.json
${input_file3_name} test_input_file3.json
*** Test Cases ***
Execute Triggered Task With Multiple Files
[Documentation] Executes the triggered task multiple times with different input files.
[Tags] snowflake task_execution multiple_files
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file1_name}
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file2_name}
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file3_name}robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
${input_file1_name} test_input_file1.json
${input_file2_name} test_input_file2.json
${input_file3_name} test_input_file3.json
*** Test Cases ***
Execute Triggered Task With Multiple Files
[Documentation] Executes the triggered task multiple times with different input files.
[Tags] snowflake task_execution multiple_files
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file1_name}
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file2_name}
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} test_input_file=${input_file3_name}Execute with Multiple Parameter Overrides
多参数覆盖执行
robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
*** Test Cases ***
Execute With Custom Parameters
[Documentation] Executes the triggered task with multiple parameter overrides.
[Tags] snowflake task_execution
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} schema=PROD table=PROD.CUSTOMERS mode=productionrobotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
*** Test Cases ***
Execute With Custom Parameters
[Documentation] Executes the triggered task with multiple parameter overrides.
[Tags] snowflake task_execution
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} schema=PROD table=PROD.CUSTOMERS mode=productionCreate with Notifications, Then Execute
创建带通知的任务并执行
robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
@{notification_states} Completed Failed
&{task_notifications}
... recipients=notify@example.com
... states=${notification_states}
&{task_params_set}
... snowflake_acct=../shared/${SNOWFLAKE_ACCOUNT_NAME}
*** Test Cases ***
Create Triggered Task With Notifications
[Documentation] Creates triggered task with email notifications.
[Tags] snowflake task_creation notifications
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} ${task_notifications} execution_timeout=300
Execute Notified Task
[Documentation] Executes the task that has notifications configured.
[Tags] snowflake task_execution notifications
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name}robotframework
*** Variables ***
${pipeline_name} snowflake_demo
${task_name} Task
@{notification_states} Completed Failed
&{task_notifications}
... recipients=notify@example.com
... states=${notification_states}
&{task_params_set}
... snowflake_acct=../shared/${SNOWFLAKE_ACCOUNT_NAME}
*** Test Cases ***
Create Triggered Task With Notifications
[Documentation] Creates triggered task with email notifications.
[Tags] snowflake task_creation notifications
[Template] Create Triggered Task From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} ${GROUNDPLEX_NAME} ${task_params_set} ${task_notifications} execution_timeout=300
Execute Notified Task
[Documentation] Executes the task that has notifications configured.
[Tags] snowflake task_execution notifications
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name}Parameter Configuration
参数配置
Defining Task Parameters (for Create)
定义任务参数(用于创建)
Task parameters are defined as a Robot Framework dictionary:
robotframework
*** Variables ***
&{task_params_set}
... account_param=../shared/${ACCOUNT_NAME}
... schema_param=DEMO
... table_param=TEST_TABLE
... input_file=${input_file_name}任务参数以Robot Framework字典形式定义:
robotframework
*** Variables ***
&{task_params_set}
... account_param=../shared/${ACCOUNT_NAME}
... schema_param=DEMO
... table_param=TEST_TABLE
... input_file=${input_file_name}Overriding Parameters (at Execute)
覆盖参数(执行时)
Parameters can be overridden at execution time using key=value syntax:
robotframework
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} input_file=different_file.json schema=PROD执行时可使用key=value语法覆盖参数:
robotframework
[Template] Run Triggered Task With Parameters From Template
${unique_id} ${PIPELINES_LOCATION_PATH} ${pipeline_name} ${task_name} input_file=different_file.json schema=PRODCommon Parameter Patterns
常见参数模式
| Parameter | Description | Example Value |
|---|---|---|
| Account reference | Path to account in SnapLogic | |
| Schema | Database schema | |
| Table | Table name | |
| Input file | Input file name | |
| Mode flag | Test/prod mode | |
| 参数 | 说明 | 示例值 |
|---|---|---|
| Account reference | SnapLogic中的账户路径 | |
| Schema | 数据库模式 | |
| Table | 表名称 | |
| Input file | 输入文件名 | |
| Mode flag | 测试/生产模式 | |
Notification Configuration
通知配置
Setting Up Notifications
设置通知
robotframework
*** Variables ***robotframework
*** Variables ***Define which states trigger notifications
Define which states trigger notifications
@{notification_states} Completed Failed
@{notification_states} Completed Failed
Configure notification settings
Configure notification settings
&{task_notifications}
... recipients=email1@example.com,email2@example.com
... states=${notification_states}
undefined&{task_notifications}
... recipients=email1@example.com,email2@example.com
... states=${notification_states}
undefinedAvailable Notification States
可用通知状态
- — Task completed successfully
Completed - — Task execution failed
Failed - — Task started execution
Started - — Task was stopped
Stopped
- — 任务成功完成
Completed - — 任务执行失败
Failed - — 任务开始执行
Started - — 任务已停止
Stopped
Typical Test Execution Flow
典型测试执行流程
┌─────────────────────────┐
│ 1. Suite Setup │
│ (Generate unique_id) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 2. Create Accounts │
│ (Database, S3, etc.) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 3. Upload Files │
│ (Input data, expr libs)│
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 4. Import Pipeline │
│ (.slp file) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 5. Create Triggered │ ◄── CREATE TASK
│ Task │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 6. Execute Triggered │ ◄── EXECUTE TASK
│ Task │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 7. Verify Results │
└─────────────────────────┘┌─────────────────────────┐
│ 1. Suite Setup │
│ (Generate unique_id) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 2. Create Accounts │
│ (Database, S3, etc.) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 3. Upload Files │
│ (Input data, expr libs)│
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 4. Import Pipeline │
│ (.slp file) │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 5. Create Triggered │ ◄── CREATE TASK
│ Task │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 6. Execute Triggered │ ◄── EXECUTE TASK
│ Task │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ 7. Verify Results │
└─────────────────────────┘MANDATORY: TRIGGERED_TASK_README.md with File Structure
强制要求:包含文件结构的TRIGGERED_TASK_README.md
IMPORTANT: Every time you create triggered task test cases, you MUST also create a TRIGGERED_TASK_README.md in the same directory with a file structure diagram.
This is required for ALL triggered tasks. No exceptions.
重要提示:每次创建触发任务测试用例时,必须在同一目录下创建TRIGGERED_TASK_README.md文档,包含文件结构示意图。
此要求适用于所有触发任务,无例外情况。
README Template
README模板
markdown
undefinedmarkdown
undefined[Type] Triggered Task Tests
[Type] Triggered Task Tests
This test suite creates AND executes triggered tasks for [Type] pipeline testing.
This test suite creates AND executes triggered tasks for [Type] pipeline testing.
Purpose
Purpose
Creates triggered task(s) for [Type] pipeline execution with configurable parameters, then executes them with optional parameter overrides.
Creates triggered task(s) for [Type] pipeline execution with configurable parameters, then executes them with optional parameter overrides.
Two Key Operations
Two Key Operations
| Operation | Keyword | Purpose |
|---|---|---|
| Create Task | | Defines the task with default parameters |
| Execute Task | | Runs the task, optionally overriding parameters |
| Operation | Keyword | Purpose |
|---|---|---|
| Create Task | | Defines the task with default parameters |
| Execute Task | | Runs the task, optionally overriding parameters |
File Structure
File Structure
project-root/
├── test/
│ └── suite/
│ └── pipeline_tests/
│ └── [type]/
│ ├── [type]_triggered_task.robot ← Test case file
│ └── TRIGGERED_TASK_README.md ← This file
└── .env ← Environment configurationproject-root/
├── test/
│ └── suite/
│ └── pipeline_tests/
│ └── [type]/
│ ├── [type]_triggered_task.robot ← Test case file
│ └── TRIGGERED_TASK_README.md ← This file
└── .env ← Environment configurationPrerequisites
Prerequisites
- [Type] account must be created ()
/create-account - Pipeline must be imported ()
/import-pipeline - Environment variables configured in
.env
- [Type] account must be created ()
/create-account - Pipeline must be imported ()
/import-pipeline - Environment variables configured in
.env
Task Parameters (Set at Creation)
Task Parameters (Set at Creation)
- — Description
[param1] - — Description
[param2]
- — Description
[param1] - — Description
[param2]
Parameter Overrides (At Execution)
Parameter Overrides (At Execution)
- — Override description
[param1] - — Override description
[param2]
- — Override description
[param1] - — Override description
[param2]
How to Run
How to Run
bash
make robot-run-all-tests TAGS="[type] AND triggered_task" PROJECT_SPACE_SETUP=True
---bash
make robot-run-all-tests TAGS="[type] AND triggered_task" PROJECT_SPACE_SETUP=True
---Troubleshooting
故障排除
Common Issues
常见问题
| Issue | Cause | Solution |
|---|---|---|
| Pipeline not imported | Run |
| Account not created | Run |
| Task not created | Run Create Triggered Task first |
| Parameter name mismatch | Check pipeline parameter names |
| Permission issue | Verify SnapLogic permissions |
| Long-running pipeline | Increase |
| Wrong key name | Check parameter name matches pipeline |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 管道未导入 | 先运行 |
| 账户未创建 | 先运行 |
| 任务未创建 | 先运行Create Triggered Task |
| 参数名称不匹配 | 检查管道参数名称 |
| 权限问题 | 验证SnapLogic权限 |
| 管道运行时间过长 | 增加 |
| 键名称错误 | 检查参数名称是否与管道匹配 |
Debug Tips
调试技巧
-
Verify task exists before executing:robotframework
Log Task: ${task_name} console=yes Log Pipeline: ${pipeline_name} console=yes -
Log execution parameters:robotframework
Log Executing with input_file: ${input_file_name} console=yes -
Log task parameters:robotframework
Log Dictionary ${task_params_set} console=yes -
Check environment variables:bash
make check-env
-
执行前验证任务是否存在:robotframework
Log Task: ${task_name} console=yes Log Pipeline: ${pipeline_name} console=yes -
记录执行参数:robotframework
Log Executing with input_file: ${input_file_name} console=yes -
记录任务参数:robotframework
Log Dictionary ${task_params_set} console=yes -
检查环境变量:bash
make check-env
Checklist Before Committing
提交前检查清单
- Pipeline is imported first
- Required accounts are created
- Task parameters match pipeline parameters
- variable defined
${task_name} - Create Triggered Task test case included
- Execute Triggered Task test case included (if needed)
- Parameter overrides use correct key names
- Test has appropriate tags (,
task_creation,task_execution)triggered_task - Documentation describes both create and execute operations
- TRIGGERED_TASK_README.md created with file structure diagram
- 管道已先导入
- 所需账户已创建
- 任务参数与管道参数匹配
- 已定义变量
${task_name} - 包含Create Triggered Task测试用例
- 包含Execute Triggered Task测试用例(若需要)
- 参数覆盖使用正确的键名称
- 测试用例已添加合适的标签(,
task_creation,task_execution)triggered_task - 文档描述了创建和执行操作
- 已创建包含文件结构示意图的TRIGGERED_TASK_README.md