Migration Guide: v1.0.0 to v2.0.0
This guide explains how to migrate AutoTrigger job definitions from the legacy v1.0.0 schema to the current v2.0.0 schema.
Overview
The v2.0.0 schema provides a simplified, more intuitive structure that better reflects the actual execution flow:
- v1.0.0: Uses
functionReferenceListwith nesteddata,transport, andactions - v2.0.0: Uses flat
pipelinestructure withsources,transform,output,delivery, andaction
Both schemas are currently supported for backward compatibility, but new reports should use v2.0.0.
Key Changes
1. Root Structure
v1.0.0:
{
"function": {
"functionReferenceList": [...]
}
}
v2.0.0:
{
"pipeline": {
"sources": [...],
"transform": {...},
"output": {...},
"delivery": {...},
"action": [...]
}
}
2. Field Name Changes
| v1.0.0 Field | v2.0.0 Field |
|---|---|
function.functionReferenceList | pipeline (single object) |
functionReferenceList[].data.selection | pipeline.sources |
functionReferenceList[].data.transformations | pipeline.transform |
functionReferenceList[].data.formatChannel | pipeline.output.formats |
functionReferenceList[].transport | pipeline.delivery.channels |
functionReferenceList[].actions | pipeline.action |
3. Metadata Structure
v1.0.0:
{
"version": "1.0.0",
"cronDefinition": "0 8 * * *"
}
v2.0.0:
{
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 8 * * *"
}
}
Typical Scenarios
The following examples demonstrate common AutoTrigger job configurations and their migration from v1.0.0 to v2.0.0.
- Basic PDF Report
- Multi-source Report
- Multi-format Report
- Data Processing Pipeline
- Scheduled API Call
- Alerting System
- Multiple PDF Reports
Example 1: Basic PDF Report
- v1.0.0
- v2.0.0
{
"$schema": "/api/asyncJobs/schema",
"name": "Daily Report",
"description": "PDF report",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 6 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "Daily Report",
"description": "Daily PDF report",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "CallData",
"parameters": [
{ "index": "calls" },
{ "size": 0, "query": { ... }, "aggs": { ... } }
]
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "CallData",
"chartTitle": "Call Volume"
}
]
}
}
]
},
"transport": ["emailChannelId"]
}
]
}
}
{
"$schema": "/api/asyncJobs/schema",
"name": "Daily Report",
"description": "PDF report",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 6 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "CallData",
"parameters": [
{ "index": "calls" },
{ "size": 0, "query": { ... }, "aggs": { ... } }
]
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "CallData",
"chartTitle": "Call Volume"
}
]
}
}
]
},
"delivery": {
"channels": ["emailChannelId"]
}
}
}
Key Differences:
pipeline.functionReferenceList[]→pipeline(single object)data.selection→sourcesdata.transformations→transformdata.formatChannel→output.formatstransport→delivery.channelsmetadata.schemaVersionandschedule.cronat root level
Example 2: Multiple Data Sources
- v1.0.0
- v2.0.0
{
"$schema": "/api/asyncJobs/schema",
"name": "Multi-Source Report",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 8 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "Multi-Source Report",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "CallData",
"parameters": [
{ "index": "calls" },
{ "size": 0, "query": { ... } }
]
},
{
"dataSource": "api",
"variableName": "ApiData",
"parameters": {
"url": "https://api.example.com/data",
"method": "GET"
}
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "CallData",
"chartTitle": "Call Data"
}
]
}
}
]
},
"transport": ["emailChannelId"]
}
]
}
}
{
"$schema": "/api/asyncJobs/schema",
"name": "Multi-Source Report",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 8 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "CallData",
"parameters": [
{ "index": "calls" },
{ "size": 0, "query": { ... } }
]
},
{
"dataSource": "api",
"variableName": "ApiData",
"parameters": {
"url": "https://api.example.com/data",
"method": "GET"
}
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "CallData",
"chartTitle": "Call Data"
}
]
}
}
]
},
"delivery": {
"channels": ["emailChannelId"]
}
}
}
Key Differences:
- Multiple sources directly under
sourcesarray transformations→transformformatChannel→output.formatstransport→delivery.channels
Example 3: Multiple Output Formats
- v1.0.0
- v2.0.0
{
"$schema": "/api/asyncJobs/schema",
"name": "Multi-Format Report",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 9 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "Multi-Format Report",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "ReportData",
"parameters": [
{ "index": "metrics" },
{ "size": 0, "query": { ... } }
]
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "ReportData",
"chartTitle": "Report Chart"
}
]
}
},
{ "transformationType": "toCsv", "parameters": {} },
{ "transformationType": "toJson", "parameters": {} }
]
},
"transport": ["emailId"],
"actions": [
{
"type": "saveToEs",
"parameters": { "stream": "report-data" }
}
]
}
]
}
}
{
"$schema": "/api/asyncJobs/schema",
"name": "Multi-Format Report",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 9 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "ReportData",
"parameters": [
{ "index": "metrics" },
{ "size": 0, "query": { ... } }
]
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "ReportData",
"chartTitle": "Report Chart"
}
]
}
},
{ "transformationType": "toCsv", "parameters": {} },
{ "transformationType": "toJson", "parameters": {} }
]
},
"delivery": {
"channels": ["emailId"]
},
"action": [
{
"type": "saveToEs",
"parameters": { "stream": "report-data" }
}
]
}
}
Key Differences:
- Multiple formats under
output.formatsarray transport→delivery.channelsactions→action(singular array)selection→sourcestransformations→transform
Example 4: Data Processing Pipeline
- v1.0.0
- v2.0.0
{
"$schema": "/api/asyncJobs/schema",
"name": "Data Pipeline",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 10 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "Data Pipeline",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "RawEvents",
"parameters": [
{ "index": "events" },
{
"size": 0,
"query": { "match_all": {} }
}
]
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toCsv",
"parameters": {}
}
]
},
"transport": ["s3Channel"],
"actions": [
{
"type": "saveToEs",
"parameters": { "stream": "processed-events" }
}
]
}
]
}
}
{
"$schema": "/api/asyncJobs/schema",
"name": "Data Pipeline",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 10 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "RawEvents",
"parameters": [
{ "index": "events" },
{
"size": 0,
"query": { "match_all": {} }
}
]
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toCsv",
"parameters": {}
}
]
},
"delivery": {
"channels": ["s3Channel"]
},
"action": [
{
"type": "saveToEs",
"parameters": { "stream": "processed-events" }
}
]
}
}
Key Differences:
transformations→transform(singular)selection→sourcesformatChannel→output.formatstransport→delivery.channelsactions→action
Example 5: Scheduled API Call
- v1.0.0
- v2.0.0
{
"$schema": "/api/asyncJobs/schema",
"name": "API Sync Job",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 11 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "API Sync Job",
"data": {
"selection": [
{
"dataSource": "api",
"variableName": "ExternalData",
"parameters": {
"url": "https://api.example.com/v1/sync",
"method": "GET"
}
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{ "transformationType": "toJson", "parameters": {} }
]
},
"transport": [],
"actions": [
{
"type": "saveToEs",
"parameters": { "stream": "synced-data" }
}
]
}
]
}
}
{
"$schema": "/api/asyncJobs/schema",
"name": "API Sync Job",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 11 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "api",
"variableName": "ExternalData",
"parameters": {
"url": "https://api.example.com/v1/sync",
"method": "GET"
}
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [{ "transformationType": "toJson", "parameters": {} }]
},
"delivery": {
"channels": []
},
"action": [
{
"type": "saveToEs",
"parameters": { "stream": "synced-data" }
}
]
}
}
Key Differences:
formatChannel→output.formats(required, at least one)transport→delivery.channelsselection→sourcestransformations→transformactions→action
Example 6: Alerting System
- v1.0.0
- v2.0.0
{
"$schema": "/api/asyncJobs/schema",
"name": "Threshold Alert",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 12 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "Threshold Alert",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "Metrics",
"parameters": [
{ "index": "metrics" },
{
"size": 0,
"aggs": {
"avg_value": { "avg": { "field": "value" } }
}
}
]
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "portrait",
"charts": [
{
"variableName": "Metrics",
"chartTitle": "Current Metrics"
}
]
}
}
]
},
"transport": ["slackChannel", "emailChannel"],
"actions": [
{
"type": "saveToEs",
"parameters": { "stream": "alerts" }
}
]
}
]
}
}
{
"$schema": "/api/asyncJobs/schema",
"name": "Threshold Alert",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 12 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "Metrics",
"parameters": [
{ "index": "metrics" },
{
"size": 0,
"aggs": {
"avg_value": { "avg": { "field": "value" } }
}
}
]
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "portrait",
"charts": [
{
"variableName": "Metrics",
"chartTitle": "Current Metrics"
}
]
}
}
]
},
"delivery": {
"channels": ["slackChannel", "emailChannel"]
},
"action": [
{
"type": "saveToEs",
"parameters": { "stream": "alerts" }
}
]
}
}
Key Differences:
transport→delivery.channelsactions→actionselection→sourcestransformations→transformformatChannel→output.formats
Example 7: Multiple PDF Reports (v1.0.0 Only)
- v1.0.0
- v2.0.0 - Recommended Approach
{
"$schema": "/api/asyncJobs/schema",
"name": "Multiple Reports (Legacy)",
"enabled": true,
"metadata": {
"schemaVersion": "1.0.0"
},
"schedule": {
"cron": "0 13 * * *"
},
"type": "user",
"pipeline": {
"functionReferenceList": [
{
"reportName": "Daily Call Report",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "CallData",
"parameters": [
{ "index": "calls" },
{ "size": 0, "query": { ... } }
]
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "CallData",
"chartTitle": "Call Volume"
}
]
}
}
]
},
"transport": ["emailChannel"]
},
{
"reportName": "Daily Metrics Report",
"data": {
"selection": [
{
"dataSource": "es",
"variableName": "MetricsData",
"parameters": [
{ "index": "metrics" },
{ "size": 0, "query": { ... } }
]
}
],
"transformations": {
"transformationType": "js",
"code": "return data;"
},
"formatChannel": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "MetricsData",
"chartTitle": "System Metrics"
}
]
}
}
]
},
"transport": ["emailChannel"]
}
]
}
}
Note: v1.0.0 supports multiple independent reports in a single job definition via functionReferenceList. Each report generates its own PDF file.
{
"$schema": "/api/asyncJobs/schema",
"name": "Daily Call Report",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 13 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "CallData",
"parameters": [
{ "index": "calls" },
{ "size": 0, "query": { ... } }
]
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "CallData",
"chartTitle": "Call Volume"
}
]
}
}
]
},
"delivery": {
"channels": ["emailChannel"]
}
}
}
AND
{
"$schema": "/api/asyncJobs/schema",
"name": "Daily Metrics Report",
"enabled": true,
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "0 13 * * *"
},
"type": "user",
"pipeline": {
"sources": [
{
"dataSource": "es",
"variableName": "MetricsData",
"parameters": [
{ "index": "metrics" },
{ "size": 0, "query": { ... } }
]
}
],
"transform": {
"transformationType": "js",
"code": "return data;"
},
"output": {
"formats": [
{
"transformationType": "toPdf",
"parameters": {
"pageSize": "A4",
"orientation": "landscape",
"charts": [
{
"variableName": "MetricsData",
"chartTitle": "System Metrics"
}
]
}
}
]
},
"delivery": {
"channels": ["emailChannel"]
}
}
}
Migration Note: v2.0.0 does not support multiple independent PDF reports in a single job. To achieve the same result:
- Create separate jobs - One job per report with the same schedule
- Use identical schedules - Both jobs run at the same time (
0 13 * * *) - Monitor independently - Each job has its own execution history and logs
Why this change? The v2.0.0 schema was redesigned to be simpler and more maintainable. Each job now has a single, focused purpose.
Key Differences:
- v1.0.0: Multiple reports in
functionReferenceList[]within one job - v2.0.0: One report per job - create multiple jobs with same schedule
- v2.0.0 provides better isolation, easier debugging, and independent monitoring
Note: Each scenario demonstrates a different use case. Choose the example that best matches your requirements and adapt the field values accordingly.
Named Function References - Future Feature
Named function references via codeFunctionReference are planned for a future release. Currently, only inline code transformations work. Do not rely on codeFunctionReference in production until explicitly supported.
Migration Steps
Step 1: Export Your Current Jobs
- Open the AutoTrigger dashboard
- Select each job you want to migrate
- Click Export to download the JSON configuration
Step 2: Review Schema Version
Check the version or metadata.schemaVersion field to confirm the schema version:
"version": "1.0.0"→ Needs migration"metadata": { "schemaVersion": "2.0.0" }→ Already on v2
Step 3: Update Root Fields
Replace:
"version": "1.0.0",
"cronDefinition": "..."
With:
"metadata": {
"schemaVersion": "2.0.0"
},
"schedule": {
"cron": "..."
}
Step 4: Restructure Pipeline
Replace the entire function.functionReferenceList structure with a pipeline object:
Before:
"function": {
"functionReferenceList": [
{
"reportName": "...",
"description": "...",
"data": {
"selection": [...],
"transformations": {...},
"formatChannel": [...]
},
"transport": [...],
"actions": [...]
}
]
}
After:
"pipeline": {
"sources": [...],
"transform": {...},
"output": {
"formats": [...]
},
"delivery": {
"channels": [...]
},
"action": [...]
}
Step 5: Update Field Names
Apply these field name changes:
data.selection→sourcesdata.transformations→transformdata.formatChannel→output.formatstransport→delivery.channelsactions→action
Step 6: Validate and Test
- Import the updated JSON using Import Job Config
- Click Run Now to test the job
- Check the execution history for any errors
- Verify the output matches your expectations
Common Migration Issues
Issue 1: Missing Transform
Problem: v2.0.0 requires an explicit transform field.
Solution: Add a default transformation with inline code:
"transform": {
"transformationType": "js",
"code": "return data;"
}
Transformation Options
Currently only inline code transformations are supported. The codeFunctionReference field is a future feature.
Issue 2: Missing Output Formats
Problem: v2.0.0 requires at least one output format in output.formats.
Solution: Add at least one format (e.g., JSON):
"output": {
"formats": [
{ "transformationType": "toJson", "parameters": {} }
]
}
Issue 3: Multiple Reports in One Job
Problem: v1.0.0 supported functionReferenceList with multiple report definitions. v2.0.0 uses a single pipeline.
Solution: Create separate jobs for each report, or combine logic into a single transformation that outputs all required formats.
Validation
After migration, verify:
- Schema validation passes - The editor should not show validation errors
- Job runs successfully - Click Run Now and check execution history
- Output is correct - Verify generated files match expectations
- Scheduled execution works - Wait for next scheduled run or trigger manually
Support
If you encounter issues during migration:
- Check the execution history for error messages
- Validate JSON against the schema at
/api/asyncJobs/schema - Compare your configuration with the examples in this guide
- Contact support with the error message and job configuration
Appendix: Field Reference
Schema Field Comparison
The following table shows the key field changes between v1.0.0 and v2.0.0:
| Aspect | v1.0.0 | v2.0.0 | Migration Notes |
|---|---|---|---|
| Schema version | metadata.schemaVersion: "1.0.0" | metadata.schemaVersion: "2.0.0" | Keep in metadata object |
| Schedule | schedule.cron | schedule.cron | Same structure |
| Pipeline container | pipeline.functionReferenceList[] | pipeline | Single object instead of array |
| Data sources | data.selection | pipeline.sources | Array of source definitions |
| Transformations | data.transformations | pipeline.transform | Singular, now at pipeline level |
| Output formats | data.formatChannel | pipeline.output.formats | Nested under output object (required) |
| Delivery channels | transport | pipeline.delivery.channels | Nested under delivery object |
| Actions | actions | pipeline.action | Singular form |
| Job name | name (root) | name (root) | Same |
Transformation Fields
| Field | v1.0.0 | v2.0.0 | Status |
|---|---|---|---|
| Transformation type | transformationType | transformationType | Same |
| Inline code | code | code | Same |
| Named function ref | codeFunctionReference | codeFunctionReference | Future feature |
Current Best Practice
Use inline code for transformations until codeFunctionReference is officially supported:
"transform": {
"transformationType": "js",
"code": "function(data) { return data; }"
}