configuring-exports
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- TIER:1 -->
<!-- TIER:1 -->
Configuring Exports
配置导出
An export is the data source in a Celigo integration. It connects to an external system and pulls data into the pipeline. Exports serve two roles:
- Source -- the starting point that fetches the primary batch of records
- Lookup -- a mid-flow enrichment step () that fetches additional data per-record during processing
isLookup: true
Both roles are used across flows, APIs, and tools.
Beyond fetching data, exports also handle post-retrieval processing before records enter the pipeline:
- Output filter -- expression-based filtering to skip records that don't match criteria
- Transform -- Transformation 2.0 expression rules to reshape/flatten response data before mapping
- preSavePage hook -- JavaScript processing on the full page of records before they enter the pipeline
- One-to-many -- when used as a lookup, fan out child records from a parent. Set and
oneToMany: trueto the child array path so each child triggers a separate lookup. Once fanned out, the array element itself is the record -- see One-to-many fan-outpathToMany - Response mapping -- when used as a lookup, extract fields from the lookup response back into the record. Configured on the flow's entry, but planned when building the lookup export. The response contains a
pageProcessors[]array and andataarray. Useerrorswhen you expect a single result (e.g., fetching one order by ID); usedata[0].fieldNamewhen multiple results are expected. Response mapping uses Transformation 1.0 syntax (extract/generate pairs), not the newer expression-based transformsdata[*].fieldName - postResponseMap hook -- JavaScript processing after response mapping merges the lookup response back into the record. Configured on the flow's entry, but planned when building the lookup export
pageProcessors[]
导出是Celigo集成中的数据源。它连接到外部系统并将数据拉取到处理流程中。导出承担两种角色:
- 源——获取首批记录的起始步骤
- 查找——流程中间的数据增强步骤(),在处理期间为每条记录获取额外数据
isLookup: true
这两种角色可用于各类流程、API和工具中。
除了获取数据外,导出还会在记录进入处理流程前进行获取后的处理:
- 输出过滤器——基于表达式的过滤规则,跳过不符合条件的记录
- 转换——使用Transformation 2.0表达式规则,在映射前重塑/扁平化响应数据
- preSavePage钩子——在记录进入处理流程前,对整页记录执行JavaScript处理
- 一对多——作为查找使用时,从父记录中展开子记录。设置并将
oneToMany: true指定为子数组路径,使每个子记录触发单独的查找。展开后,数组元素本身即为记录——详见一对多展开pathToMany - 响应映射——作为查找使用时,从查找响应中提取字段并合并回原记录。配置在流程的项中,但需在构建查找导出时规划。响应包含
pageProcessors[]数组和data数组。预期单个结果时使用errors(例如,通过ID获取单个订单);预期多个结果时使用data[0].fieldName。响应映射使用Transformation 1.0语法(提取/生成对),而非较新的基于表达式的转换data[*].fieldName - postResponseMap钩子——响应映射将查找响应合并回原记录后,执行JavaScript处理。配置在流程的项中,但需在构建查找导出时规划
pageProcessors[]
Export Execution Pipeline
导出执行流程
When a flow runs, each export executes this pipeline in strict order:
- API request / query / file read -- fetches raw data from the external system
- Response parsing -- extracts the record array from the response body or file (e.g.,
resourcePathfor HTTP,http.response.resourcePathfor JSON files, XPath for XML)file.json.resourcePath - Transformation (optional) -- reshapes individual records after extraction (Transformation 2.0)
transform - Output filter (optional) -- discards records that don't match filter expression rules
- preSavePage hook (optional) -- JavaScript processing on the full page of records
Key distinction: tells the export WHERE to find records in the response. Transforms reshape WHAT each record looks like after extraction. When a user says "extract records from X" or "treat each X as a separate record", that's almost always a change, not a transform. Use transforms when you need to flatten nested objects, rename fields, or restructure individual records.
resourcePathresourcePath当流程运行时,每个导出都会严格按照以下顺序执行流程:
- API请求/查询/文件读取——从外部系统获取原始数据
- 响应解析——从响应体或文件中提取记录数组(例如,HTTP使用
resourcePath,JSON文件使用http.response.resourcePath,XML使用XPath)file.json.resourcePath - 转换(可选)——在提取后重塑单个记录(Transformation 2.0)
transform - 输出过滤器(可选)——丢弃不符合过滤表达式规则的记录
- preSavePage钩子(可选)——对整页记录执行JavaScript处理
关键区别:告知导出在响应中的何处查找记录。转换则用于重塑提取后每条记录的内容。当用户说“从X中提取记录”或“将每个X视为单独记录”时,这几乎总是需要修改,而非转换。仅当需要扁平化嵌套对象、重命名字段或重构单个记录时,才使用转换。
resourcePathresourcePathThree Categories of Export
导出的三类类型
Not all exports work the same way. Before building, understand which category you need:
并非所有导出的工作方式都相同。在构建前,需明确你需要的类型:
Listeners
监听器
Receive data pushed to Celigo from an external system. No polling, no scheduling -- the source system sends data when events happen.
- -- inbound HTTP listener (no connection required)
WebhookExport - -- AS2 EDI file reception
AS2Export - Distributed exports () -- real-time event-driven push for NetSuite (via SuiteScript) and Salesforce (via streaming API). The platform installs listeners in the source system that fire when records change.
type: "distributed" - Change data capture () -- MongoDB change streams that tail the oplog for real-time record changes.
type: "stream"
When to use: The source system supports outbound webhooks, push notifications, or change data capture and you want real-time processing.
接收外部系统推送到Celigo的数据。无需轮询、无需调度——源系统在事件发生时发送数据。
- ——入站HTTP监听器(无需连接)
WebhookExport - ——AS2 EDI文件接收
AS2Export - 分布式导出()——NetSuite(通过SuiteScript)和Salesforce(通过流API)的实时事件驱动推送。平台会在源系统中安装监听器,当记录变更时触发。
type: "distributed" - 变更数据捕获()——MongoDB变更流,通过监听oplog获取实时记录变更。
type: "stream"
**适用场景:**源系统支持出站Webhook、推送通知或变更数据捕获,且你需要实时处理。
File Transfers
文件传输
Read files from a remote location, then either parse them into records or transfer them as blobs.
- /
FTPExport/S3Export-- fetch files from FTP/SFTP, S3, or local filesystemFileSystemExport - with
HTTPExport-- fetch files over HTTP from cloud storage APIs (Google Drive, Box, Dropbox, Azure Blob Storage). The HTTP connector handles auth; thehttp.type: "file"config handles parsing.file{} - with
NetSuiteExport-- fetch and parse files (CSV, JSON, XLSX, XML, EDI) from the NetSuite file cabinetnetsuite.type: "file" - Parsed mode () -- CSV, XML, JSON, XLSX, EDI files are parsed into individual records
file.output: "records" - Blob mode () -- binary files transferred as-is without parsing. Supported on HTTPExport, NetSuiteExport, SalesforceExport, FTPExport, and S3Export.
type: "blob"
When to use: The source system drops files (CSV, EDI, XML, etc.) into a directory, bucket, file cabinet, or cloud storage rather than exposing a record-based API.
从远程位置读取文件,然后将其解析为记录或作为二进制大对象传输。
- /
FTPExport/S3Export——从FTP/SFTP、S3或本地文件系统获取文件FileSystemExport - 搭配
HTTPExport——通过HTTP从云存储API(Google Drive、Box、Dropbox、Azure Blob Storage)获取文件。HTTP连接器处理认证;http.type: "file"配置处理解析。file{} - 搭配
NetSuiteExport——从NetSuite文件柜获取并解析文件(CSV、JSON、XLSX、XML、EDI)netsuite.type: "file" - 解析模式()——CSV、XML、JSON、XLSX、EDI文件被解析为单个记录
file.output: "records" - 二进制模式()——二进制文件按原样传输,不进行解析。支持
type: "blob"、HTTPExport、NetSuiteExport、SalesforceExport和FTPExport。S3Export
**适用场景:**源系统将文件(CSV、EDI、XML等)存入目录、存储桶、文件柜或云存储,而非提供基于记录的API。
Record-Based Exports
基于记录的导出
Actively fetch batches of records from an API or database on a schedule.
- -- REST/GraphQL APIs
HTTPExport - -- saved searches, restlets, SuiteQL
NetSuiteExport - -- SOQL/Bulk queries
SalesforceExport - -- SQL SELECT queries
RDBMSExport - ,
MongodbExport,JDBCExport-- other databasesDynamodbExport - -- custom stack (Walmart, BigCommerce)
WrapperExport
When to use: You need to poll an API or query a database for records on a schedule (full fetch or delta/incremental).
按计划主动从API或数据库获取批量记录。
- ——REST/GraphQL API
HTTPExport - ——已保存搜索、Restlet、SuiteQL
NetSuiteExport - ——SOQL/批量查询
SalesforceExport - ——SQL SELECT查询
RDBMSExport - 、
MongodbExport、JDBCExport——其他数据库DynamodbExport - ——自定义栈(Walmart、BigCommerce)
WrapperExport
**适用场景:**你需要按计划轮询API或查询数据库以获取记录(全量获取或增量获取)。
Quick Reference
快速参考
Adaptor Decision Matrix
适配器决策矩阵
| Your data comes from... | Use adaptorType | Category | Read schema |
|---|---|---|---|
| REST or GraphQL API | | Record-based | http.yml |
| Files over HTTP (Google Drive, Box, Dropbox, Azure Blob) | | File transfer | http.yml + file.yml |
| NetSuite (any method) | | Record-based | netsuite.yml |
| Salesforce objects | | Record-based | salesforce.yml |
| SQL database | | Record-based | rdbms.yml |
| MongoDB | | Record-based | mongodb.yml |
| JDBC database | | Record-based | jdbc.yml |
| DynamoDB | | Record-based | dynamodb.yml |
| Files on FTP/SFTP | | File transfer | ftp.yml + file.yml |
| Files on S3 | | File transfer | s3.yml + file.yml |
| Webhooks / push events | | Listener | webhook.yml |
| AS2 EDI messages | | Listener | as2.yml |
| Manual file upload | | File transfer | simple.yml |
| Local filesystem | | File transfer | filesystem.yml + file.yml |
| Pre-built stack connector | | Record-based | wrapper.yml |
Raw HTTP is the fallback, not the default. Pick the most specific match, in order:
- Native adaptor -- if the application has its own row (NetSuite, Salesforce, databases, FTP/S3), use it. Do not build an against that app's REST API.
HTTPExport - Pre-built HTTP connector -- for any other REST/GraphQL app, check the 550+ connector catalog before writing HTTP config (see Check for a pre-built connector). The step is still an , but it runs on a connector-backed connection and takes its endpoint config from the connector.
HTTPExport - Manual HTTP -- hand-write the config from public API docs only when no connector exists or it doesn't cover the endpoint you need.
adaptorTypeHTTPExporthttpExport| 数据来源... | 使用的adaptorType | 类别 | 参考Schema |
|---|---|---|---|
| REST或GraphQL API | | 基于记录 | http.yml |
| HTTP协议传输的文件(Google Drive、Box、Dropbox、Azure Blob) | | 文件传输 | http.yml + file.yml |
| NetSuite(任意方式) | | 基于记录 | netsuite.yml |
| Salesforce对象 | | 基于记录 | salesforce.yml |
| SQL数据库 | | 基于记录 | rdbms.yml |
| MongoDB | | 基于记录 | mongodb.yml |
| JDBC数据库 | | 基于记录 | jdbc.yml |
| DynamoDB | | 基于记录 | dynamodb.yml |
| FTP/SFTP上的文件 | | 文件传输 | ftp.yml + file.yml |
| S3上的文件 | | 文件传输 | s3.yml + file.yml |
| Webhook/推送事件 | | 监听器 | webhook.yml |
| AS2 EDI消息 | | 监听器 | as2.yml |
| 手动文件上传 | | 文件传输 | simple.yml |
| 本地文件系统 | | 文件传输 | filesystem.yml + file.yml |
| 预构建栈连接器 | | 基于记录 | wrapper.yml |
**原生HTTP是 fallback 选项,而非默认选项。**按以下顺序选择最匹配的适配器:
- 原生适配器——如果应用有对应的行(NetSuite、Salesforce、数据库、FTP/S3),请使用它。不要针对该应用的REST API构建。
HTTPExport - 预构建HTTP连接器——对于其他REST/GraphQL应用,在编写HTTP配置前先查看550+连接器目录(详见检查预构建连接器)。该步骤仍为,但运行在连接器支持的连接上,并从连接器获取端点配置。
HTTPExport - 手动HTTP配置——仅当不存在连接器或连接器未覆盖你需要的端点时,才根据公开API文档手动编写配置。
adaptorTypeHTTPExporthttpExportMinimum Required Fields
必填字段
Every export needs at minimum:
- -- human-readable label
name - -- from the matrix above
adaptorType - -- except
_connectionIdandWebhookExportSimpleExport - Adaptor config block -- ,
http{},netsuite{},ftp{},salesforce{}, etc.rdbms{}
每个导出至少需要以下字段:
- ——人类可读的标签
name - ——来自上述矩阵
adaptorType - ——
_connectionId和WebhookExport除外SimpleExport - 适配器配置块——、
http{}、netsuite{}、ftp{}、salesforce{}等rdbms{}
Which Schemas to Read
需参考的Schema
- Always: request.yml (base fields for all exports)
- Plus: the adaptor-specific file from the matrix above (e.g., for HTTPExport)
http.yml - If file-based: also file.yml (CSV, XML, JSON, XLSX, EDI parsing config)
- If delta/incremental: check delta.yml or Handlebars URI pattern ()
{{{lastExportDateTime}}} - If cloning: clone-request.yml, clone-response.yml
- 必看:request.yml(所有导出的基础字段)
- **附加:**上述矩阵中的适配器特定文件(例如,参考
HTTPExport)http.yml - **如果是文件导出:**还需参考file.yml(CSV、XML、JSON、XLSX、EDI解析配置)
- **如果是增量同步:**查看delta.yml或Handlebars URI模式()
{{{lastExportDateTime}}} - 如果是克隆:clone-request.yml、clone-response.yml
Schema Index
Schema索引
All schemas are in references/schemas/:
- Base fields (all exports): request.yml
- Response shape: response.yml
- Adaptor-specific config:
- http.yml -- HTTP/REST/GraphQL
- netsuite.yml -- NetSuite (restlet, saved search, SuiteQL, file cabinet)
- salesforce.yml -- Salesforce (SOQL, bulk)
- ftp.yml -- FTP/SFTP
- s3.yml -- Amazon S3
- rdbms.yml -- SQL databases
- mongodb.yml -- MongoDB
- jdbc.yml -- JDBC databases
- dynamodb.yml -- DynamoDB
- as2.yml -- AS2 EDI
- wrapper.yml -- custom stack connectors
- filesystem.yml -- local filesystem
- simple.yml -- data loader / manual upload
- File parsing: file.yml (CSV, XML, JSON, XLSX, EDI)
- Operational modes: delta.yml, webhook.yml, distributed.yml, once.yml
- Mock output: mock-output.yml
- Clone: clone-request.yml, clone-response.yml
所有Schema都在references/schemas/目录下:
- 基础字段(所有导出):request.yml
- 响应格式:response.yml
- 适配器特定配置:
- http.yml——HTTP/REST/GraphQL
- netsuite.yml——NetSuite(Restlet、已保存搜索、SuiteQL、文件柜)
- salesforce.yml——Salesforce(SOQL、批量)
- ftp.yml——FTP/SFTP
- s3.yml——Amazon S3
- rdbms.yml——SQL数据库
- mongodb.yml——MongoDB
- jdbc.yml——JDBC数据库
- dynamodb.yml——DynamoDB
- as2.yml——AS2 EDI
- wrapper.yml——自定义栈连接器
- filesystem.yml——本地文件系统
- simple.yml——数据加载器/手动上传
- 文件解析:file.yml(CSV、XML、JSON、XLSX、EDI)
- 运行模式:delta.yml、webhook.yml、distributed.yml、once.yml
- 模拟输出:mock-output.yml
- 克隆:clone-request.yml、clone-response.yml
Related Skills
相关技能
- configuring-connections > Quick Reference -- connection types, auth methods, iClients
- writing-mappings > Transformation 2.0 -- reshape export output before mapping
- writing-scripts > Data Pipeline Hooks -- preSavePage, postResponseMap hooks
- writing-handlebars > Quick Reference -- dynamic values in URIs, filters, delta tokens
- building-flows > How to Build a Flow -- wiring exports into flows
- troubleshooting-flows > Diagnostic Workflow -- diagnosing export-related failures
- configuring-connections > 快速参考——连接类型、认证方式、iClients
- writing-mappings > Transformation 2.0——映射前重塑导出输出
- writing-scripts > 数据流程钩子——preSavePage、postResponseMap钩子
- writing-handlebars > 快速参考——URI、过滤器、增量令牌中的动态值
- building-flows > 如何构建流程——将导出接入流程
- troubleshooting-flows > 诊断流程——诊断导出相关故障
How to Build an Export
如何构建导出
1. Identify the target application
1. 确定目标应用
What system are you pulling data from? This determines everything -- adaptor type, connection type, and configuration shape.
你要从哪个系统拉取数据?这决定了所有内容——适配器类型、连接类型和配置格式。
2. Check for existing patterns
2. 检查现有模式
Before building from scratch, look at what already exists:
bash
undefined在从头构建之前,先查看已有的资源:
bash
undefinedSearch across the entire account for related resources
在整个账户中搜索相关资源
celigo account search "<keyword>"
celigo account search "<keyword>"
Show what an existing export uses (connection) and what uses it (flows)
查看现有导出使用的连接以及哪些流程使用了该导出
celigo account dependencies export <id>
celigo account dependencies export <id>
Find orphaned exports not referenced by any flow
查找未被任何流程引用的孤立导出
celigo account lint
celigo account lint
Check if a similar export already exists in the account
检查账户中是否已存在类似的导出
celigo exports list | grep -i "<application-name>"
celigo exports list | grep -i "<application-name>"
Search the marketplace for pre-built integration templates
在市场中搜索预构建的集成模板
celigo templates marketplace
celigo templates marketplace
Preview a template to see its export configuration
预览模板以查看其导出配置
celigo templates preview <id> --model Export
celigo templates preview <id> --summary
The account index auto-refreshes when stale (>4 hours). Force a fresh snapshot with `celigo account snapshot`.
Existing exports in the account are the best reference -- they show proven patterns for that specific customer's setup. Marketplace templates may provide a complete pre-built integration you can install rather than building from scratch.celigo templates preview <id> --model Export
celigo templates preview <id> --summary
账户索引在过期(>4小时)时会自动刷新。使用`celigo account snapshot`强制生成新的快照。
账户中的现有导出是最佳参考——它们展示了针对特定客户设置的已验证模式。市场模板可能提供完整的预构建集成,你可以直接安装而非从头构建。3. Check for a pre-built connector
3. 检查预构建连接器
Always run this check before writing any HTTP config. Celigo maintains 550+ HTTP connector definitions and 590+ trading partner connectors. These provide pre-configured auth, base URLs, and endpoint definitions for common applications. Connectors are set on the connection, not the export -- but they determine what the export can do. Hand-write a manual from public API docs only when this search comes up empty or the connector doesn't cover the endpoint you need.
HTTPExportbash
undefined在编写任何HTTP配置前务必执行此检查。Celigo维护了550+ HTTP连接器定义和590+交易伙伴连接器。这些连接器为常见应用提供了预配置的认证、基础URL和端点定义。连接器设置在连接上,而非导出上——但它们决定了导出能执行的操作。仅当搜索结果为空或连接器未覆盖你需要的端点时,才根据公开API文档手动编写配置。
HTTPExportbash
undefinedSearch HTTP connectors (REST APIs: Shopify, Stripe, HubSpot, etc.)
搜索HTTP连接器(REST API:Shopify、Stripe、HubSpot等)
celigo http-connectors list | grep -i "<application-name>"
celigo http-connectors get <id> --full # see endpoints, resources, auth config
celigo http-connectors list | grep -i "<application-name>"
celigo http-connectors get <id> --full # 查看端点、资源、认证配置
Drill into the endpoints the connector defines for exports
深入查看连接器为导出定义的端点
celigo http-connectors catalog <id> --resource-type export --published-only
celigo http-connectors endpoint-detail <id> --resource-type export --resource-id <rid> --endpoint-id <epid>
celigo http-connectors catalog <id> --resource-type export --published-only
celigo http-connectors endpoint-detail <id> --resource-type export --resource-id <rid> --endpoint-id <epid>
Search trading partner connectors (EDI, AS2, VAN)
搜索交易伙伴连接器(EDI、AS2、VAN)
celigo tp-connectors list
If an HTTP connector exists for your target app, create the connection from it (`http._httpConnectorId` -- see [configuring-connections > Check for a pre-built connector and global iClient](../configuring-connections/SKILL.md#4-check-for-a-pre-built-connector-and-global-iclient)) and take the export's `relativeURI`, method, pagination, and response paths from the connector's endpoint metadata rather than reconstructing them from public API docs. The connector-reference fields on the export itself (`http._httpConnectorEndpointId`, `http._httpConnectorVersionId`, `http._httpConnectorResourceId`) are read-only -- the platform sets them; what you control is the connection and the endpoint config you copy from the connector.
If a trading partner connector exists (EDI/AS2), reference it on the export via `ftp._tpConnectorId` (FTP exports) or `as2._tpConnectorId` (AS2 exports). You may also need to set `_ediProfileId` on the export for EDI document validation.celigo tp-connectors list
如果目标应用存在HTTP连接器,请基于它创建连接(`http._httpConnectorId`——详见[configuring-connections > 检查预构建连接器和全局iClient](../configuring-connections/SKILL.md#4-check-for-a-pre-built-connector-and-global-iclient)),并从连接器的端点元数据中获取导出的`relativeURI`、方法、分页和响应路径,而非根据公开API文档重新构建。导出本身的连接器参考字段(`http._httpConnectorEndpointId`、`http._httpConnectorVersionId`、`http._httpConnectorResourceId`)是只读的——由平台设置;你需要控制的是连接以及从连接器复制的端点配置。
如果存在交易伙伴连接器(EDI/AS2),通过`ftp._tpConnectorId`(FTP导出)或`as2._tpConnectorId`(AS2导出)在导出中引用它。你可能还需要在导出上设置`_ediProfileId`以进行EDI文档验证。4. Query metadata for the target system
4. 查询目标系统的元数据
For NetSuite, Salesforce, and RDBMS connections, you can discover available record types and fields directly from the live system:
bash
undefined对于NetSuite、Salesforce和RDBMS连接,你可以直接从实时系统中发现可用的记录类型和字段:
bash
undefinedList available record types / sObjects / tables
列出可用的记录类型/sObjects/表
NetSuite also returns saved searches alongside record types
NetSuite还会返回已保存搜索和记录类型
celigo metadata types <connectionId>
celigo metadata types <connectionId>
List fields for a specific entity type
列出特定实体类型的字段
celigo metadata fields <connectionId> <entityType>
This tells you what data is available to export before you write any configuration.
- **NetSuite:** `metadata types` returns both record types and saved searches (with IDs you need for `netsuite.restlet.searchId`). `metadata fields` returns field IDs, names, types, and group — including sublist fields you'll need for `mapping.lists[].generate` on the import side.
- **Salesforce:** `metadata types` returns sObjects with queryable/createable flags. `metadata fields` returns fields, types, and relationship names — use these to discover child objects for `distributed.relatedLists[]` and relationship field names for cross-object queries.
- **RDBMS:** `metadata types` returns table names. `metadata fields` returns column names and types for a given table — use these when writing SQL queries or building field mappings.celigo metadata fields <connectionId> <entityType>
这能让你在编写任何配置前了解可导出的数据。
- **NetSuite:**`metadata types`返回记录类型和已保存搜索(包含`netsuite.restlet.searchId`所需的ID)。`metadata fields`返回字段ID、名称、类型和分组——包括导入端`mapping.lists[].generate`所需的子列表字段。
- **Salesforce:**`metadata types`返回带有可查询/可创建标记的sObjects。`metadata fields`返回字段、类型和关系名称——用于发现`distributed.relatedLists[]`的子对象以及跨对象查询的关系字段名称。
- **RDBMS:**`metadata types`返回表名。`metadata fields`返回给定表的列名和类型——用于编写SQL查询或构建字段映射。5. Determine the category
5. 确定导出类型
Is this a listener (real-time push from the source), a file transfer (fetch and parse/transfer files), or a record-based export (poll an API or query a database)? This narrows which adaptor types and modes apply.
这是监听器(源系统实时推送)、文件传输(获取并解析/传输文件)还是基于记录的导出(轮询API或查询数据库)?这会缩小适用的适配器类型和模式范围。
6. Choose the right adaptor type
6. 选择合适的适配器类型
Use the Adaptor Decision Matrix in Quick Reference above to select the correct for your target system.
adaptorType使用上述快速参考中的适配器决策矩阵为目标系统选择正确的。
adaptorType7. Build the export JSON
7. 构建导出JSON
Use the Schema Index and Which Schemas to Read in Quick Reference above. Read for base fields, then the adaptor-specific schema, plus if file-based and if incremental.
request.ymlfile.ymldelta.yml使用上述快速参考中的Schema索引和需参考的Schema。先查看获取基础字段,再查看适配器特定的Schema,如果是文件导出还需查看,如果是增量同步则查看。
request.ymlfile.ymldelta.ymlExport Design Decisions
导出设计决策
A few design choices recur when building exports. Each has a defensible default once the framing is clear.
构建导出时会遇到一些常见的设计选择。一旦明确场景,每个选择都有合理的默认值。
Delta vs one-time vs full sync
增量同步 vs 一次性同步 vs 全量同步
The export's field selects the sync behavior:
type- Delta () -- pulls only records created or modified since the last successful run. The default for ongoing scheduled syncs when the source exposes a usable "last modified" timestamp. Non-HTTP adaptors set the timestamp field via
type: "delta"; HTTP exports instead embeddelta.dateFieldin the{{{lastExportDateTime}}}or body. See delta.yml.relativeURI - One-time () -- processes each record exactly once via a tracking flag: each run selects records where
type: "once"isonce.booleanField, then sets it tofalseafter a page succeeds so later runs skip them. Use for backfills and migrations, or when the source has no reliable timestamp but its records can carry a processed flag. See once.yml.true - Full (neither nor
deltamode) -- re-pulls the entire dataset every run. Use when the source has no usable modification timestamp, the dataset is small enough that re-pulling is cheap, or business logic requires a fresh snapshot each run.once
When the request is vague ("sync customers"), confirm which kind of sync is intended before building. Delta is a reasonable default when the source exposes a timestamp field; full is reasonable for small static datasets.
导出的字段选择同步行为:
type- 增量()——仅拉取自上次成功运行以来创建或修改的记录。当源系统提供可用的“最后修改”时间戳时,这是持续计划同步的默认选项。非HTTP适配器通过
type: "delta"设置时间戳字段;HTTP导出则在delta.dateField或请求体中嵌入relativeURI。详见delta.yml。{{{lastExportDateTime}}} - 一次性()——通过跟踪标记确保每条记录仅处理一次:每次运行选择
type: "once"为once.booleanField的记录,在页面处理成功后将其设置为false,以便后续运行跳过这些记录。适用于回填和迁移,或源系统无可靠时间戳但记录可携带处理标记的场景。详见once.yml。true - 全量(既非也非
delta模式)——每次运行重新拉取整个数据集。适用于源系统无可用修改时间戳、数据集足够小以至于重新拉取成本低,或业务逻辑要求每次运行获取最新快照的场景。once
当需求模糊时(例如“同步客户”),在构建前确认所需的同步类型。当源系统提供时间戳字段时,增量同步是合理的默认选项;对于小型静态数据集,全量同步是合理的选择。
Listener/webhook vs scheduled export
监听器/Webhook vs 计划导出
Both are starting steps (see Three Categories of Export); the choice is driven by what the source supports and the latency budget, not preference:
- Reach for a listener (, or NetSuite/Salesforce
WebhookExport) when the source pushes events and the flow needs to react quickly ("when X happens, do Y").type: "distributed" - Reach for a scheduled export when the source has no push mechanism, or when batch timing at off-peak hours is acceptable.
NetSuite and Salesforce support both for many record types. Mixing them on one flow is a common, good pattern -- a listener handles low-latency reactions while a scheduled export runs as a safety net for backfills, end-of-day reconciliation, and catching up after a webhook outage.
两者都是起始步骤(详见导出的三类类型);选择取决于源系统支持的功能和延迟要求,而非偏好:
- 当源系统支持推送事件且流程需要快速响应时(“当X发生时,执行Y”),选择监听器(,或NetSuite/Salesforce的
WebhookExport)。type: "distributed" - 当源系统无推送机制,或可接受在非高峰时段批量处理时,选择计划导出。
NetSuite和Salesforce的许多记录类型同时支持这两种方式。在一个流程中混合使用它们是常见且良好的模式——监听器处理低延迟响应,而计划导出作为回填、日终对账和Webhook故障后追补的安全网。
Lookup export vs separate scheduled export
查找导出 vs 单独的计划导出
The distinguishing question is when the data is needed:
- A lookup export () runs per in-flight record, mid-pipeline, keyed off the upstream record -- fetching the customer for a specific order, or inventory for a specific SKU.
isLookup: true - A scheduled export runs once per flow run as a starting point, producing the first batch of records the flow processes.
If the request is "for each X, look up Y", it's a lookup. If it's "every hour, pull all Y", it's a scheduled export.
区分的关键在于数据的需求时机:
- 查找导出()针对流程中的每条记录运行,在流程中间根据上游记录的键获取数据——例如,为特定订单查找客户,或为特定SKU查找库存。
isLookup: true - 计划导出在每次流程运行时作为起始步骤运行一次,生成流程处理的首批记录。
如果需求是“为每个X查找Y”,则使用查找导出。如果需求是“每小时拉取所有Y”,则使用计划导出。
One-to-many fan-out -- the array element IS the record
一对多展开——数组元素即为记录
With and set to a child array path, each element of that array triggers its own lookup. Once fanned out, the element becomes the record: templates reference the element's own fields as -- not , and not . The array wrapper is gone; you are inside one element.
oneToMany: truepathToMany{{record.variantId}}{{variantId}}{{record.lineItems.variantId}}Three consequences worth knowing before you debug the wrong thing:
- The build-time preview warning is expected. Previewing a fanned-out lookup in isolation reports "not defined in the model" because no upstream record is bound yet. That is not a broken template -- don't "fix" a correct
<field>reference because of it.{{record.X}} - Response mapping merges per element automatically. To get looked-up values back onto each element, author a normal top-level response mapping; Celigo merges each result into its corresponding fanned-out element.
fields - Two anti-patterns. Don't target the array with a entry (that nests a new array inside each element), and don't attempt the per-element merge in
lists(it sees the page of parent records, not per-element results).postResponseMap
设置并将指定为子数组路径后,该数组的每个元素都会触发单独的查找。展开后,元素本身即为记录:模板引用元素自身的字段为——而非,也非。数组包装已消失;你操作的是单个元素。
oneToMany: truepathToMany{{record.variantId}}{{variantId}}{{record.lineItems.variantId}}在调试前需了解三个重要影响:
- **构建时预览警告是正常现象。**单独预览展开后的查找会提示“未在模型中定义”,因为此时尚未绑定上游记录。这并非模板错误——不要因此修改正确的
<field>引用。{{record.X}} - **响应映射会自动按元素合并。**要将查找值合并到每个元素中,编写常规的顶层响应映射即可;Celigo会将每个结果合并到对应的展开元素中。
fields - **两种反模式。**不要用项指向数组(这会在每个元素中嵌套新数组),也不要尝试在
lists中进行按元素合并(它看到的是父记录页面,而非按元素的结果)。postResponseMap
Source-side transform vs destination-side mapping
源端转换 vs 目标端映射
Both reshape data, but in opposite directions:
- A transform on a source export reshapes records as they enter the flow -- flattening nested responses, or aligning multiple sources to a common shape (see Export Execution Pipeline).
- A mapping on a downstream import reshapes records as they leave the flow toward a destination.
Don't add a transform to "match a destination" -- that's the destination import mapping's job. Transforms are for entry reshaping; mappings are for exit reshaping.
两者都会重塑数据,但方向相反:
- 源导出的转换在记录进入流程时重塑数据——扁平化嵌套响应,或使多个源的数据对齐为通用格式(详见导出执行流程)。
- 下游导入的映射在记录离开流程前往目标系统时重塑数据。
不要为“匹配目标系统”添加转换——这是目标导入映射的职责。转换用于入口数据重塑;映射用于出口数据重塑。
Async APIs (submit, poll, fetch)
异步API(提交、轮询、获取)
Most APIs return data in the same call and need none of this. Some APIs only acknowledge a request (an HTTP 202, a job ticket, a feed or document id) and process it in the background -- Amazon SP-API feeds, large report generators, bulk extract and file-conversion jobs. For those, attach an async helper to the export via . The helper teaches the step the submit-poll-fetch pattern; it is part of the export, not something managed on its own, and bundles three pieces:
http._asyncHelperId- A status export (required) -- run on each poll to ask "is it done yet?". Configure the status path to read in the response, the case-sensitive in-progress / done / done-without-data / error value lists (taken from the API's docs), and the initial wait and poll wait intervals in minutes.
- A result export (optional, usually present) -- fetches the final payload once status reports done.
- Initial-submission handling -- where to find the job ticket in the first acknowledgement: "same as status" when the acknowledgement is itself shaped like a status response, otherwise a resource path (plus transform rules for non-JSON acknowledgements, e.g. Amazon's XML).
Two constraints shape the design: the status and result exports must be ordinary synchronous exports (an async helper cannot nest another), and the async-configured step cannot carry its own transform, output filter, or preSavePage hook -- put any reshaping or filtering on the dedicated result export instead. The same pattern applies symmetrically to imports writing to asynchronous destinations ( on the import).
_asyncHelperIdReach for an async helper only when the API genuinely forces the fire-and-check-back shape. Adding one to a synchronous API is pure overhead -- extra polling plus a status and result export to maintain.
大多数API会在同一调用中返回数据,无需额外处理。部分API仅确认请求(HTTP 202、工单、Feed或文档ID)并在后台处理——例如Amazon SP-API Feed、大型报表生成器、批量提取和文件转换任务。对于这类API,通过将异步助手附加到导出。助手会告知步骤提交-轮询-获取的模式;它是导出的一部分,而非独立管理的资源,包含三个部分:
http._asyncHelperId- 状态导出(必填)——每次轮询时运行,询问“处理完成了吗?”。配置状态路径以读取响应,区分大小写的进行中/完成/无数据完成/错误值列表(取自API文档),以及初始等待和轮询等待间隔(分钟)。
- 结果导出(可选,通常存在)——当状态报告完成时获取最终负载。
- 初始提交处理——在首次确认中查找工单的位置:当确认本身的格式与状态响应相同时,使用“与状态相同”;否则使用资源路径(加上针对非JSON确认的转换规则,例如Amazon的XML)。
设计受两个约束:状态和结果导出必须是普通的同步导出(异步助手不能嵌套另一个异步助手),且配置了异步的步骤不能携带自己的转换、输出过滤器或preSavePage钩子——将任何重塑或过滤逻辑放在专用的结果导出中。相同模式对称适用于写入异步目标的导入(在导入上设置)。
_asyncHelperId仅当API确实要求先触发再检查的模式时,才使用异步助手。为同步API添加异步助手纯粹是额外开销——额外的轮询加上需要维护的状态和结果导出。
CLI Commands
CLI命令
bash
undefinedbash
undefinedCRUD
CRUD操作
celigo exports list
celigo exports get <id>
celigo exports create < export.json
celigo exports update <id> < export.json
celigo exports set <id> key=value [key2=value2 ...]
celigo exports delete <id>
celigo exports list
celigo exports get <id>
celigo exports create < export.json
celigo exports update <id> < export.json
celigo exports set <id> key=value [key2=value2 ...]
celigo exports delete <id>
Invoke (test-run an export, see what data comes back)
调用(测试运行导出,查看返回的数据)
celigo exports invoke [id] [--all]
celigo exports invoke [id] [--all]
Clone and connection management
克隆和连接管理
echo '{"connectionMap":{"oldConnId":"newConnId"}}' | celigo exports clone <id>
celigo exports replace-connection <id> <newConnectionId>
echo '{"connectionMap":{"oldConnId":"newConnId"}}' | celigo exports clone <id>
celigo exports replace-connection <id> <newConnectionId>
Discovery
发现
celigo account search "<keyword>"
celigo templates marketplace
celigo templates preview <id> --model Export
celigo templates preview <id> --summary
celigo http-connectors list
celigo http-connectors catalog <id> --resource-type export --published-only
celigo http-connectors endpoint-detail <id> --resource-type export --resource-id <rid> --endpoint-id <epid>
celigo tp-connectors list
celigo metadata types <connectionId>
celigo metadata fields <connectionId> <entityType>
celigo account search "<keyword>"
celigo templates marketplace
celigo templates preview <id> --model Export
celigo templates preview <id> --summary
celigo http-connectors list
celigo http-connectors catalog <id> --resource-type export --published-only
celigo http-connectors endpoint-detail <id> --resource-type export --resource-id <rid> --endpoint-id <epid>
celigo tp-connectors list
celigo metadata types <connectionId>
celigo metadata fields <connectionId> <entityType>
Debug
调试
celigo exports enable-debug <id> [--duration <minutes>]
celigo exports disable-debug <id>
<!-- TIER:3 -->celigo exports enable-debug <id> [--duration <minutes>]
celigo exports disable-debug <id>
<!-- TIER:3 -->Pre-Submit Checklist
提交前检查清单
Before creating or updating an export, verify:
- is exact -- case-sensitive, matches the Adaptor Decision Matrix (e.g.,
adaptorType, notHTTPExportorhttpExport)HttpExport - Pre-built connector was checked -- for HTTP exports, found no connector for the app (or the connector lacks the endpoint) before any hand-written
celigo http-connectors listrelativeURI - is valid -- points to an existing, online connection of the correct type. Not needed for
_connectionIdorWebhookExportSimpleExport - Adaptor config block is present -- ,
http{},netsuite{}, etc. matches theftp{}adaptorType - or query is correct -- wrong path silently returns 0 records with no error
resourcePath - Pagination is configured -- for HTTP exports, set if the API returns paginated results
http.paging - Delta/incremental is configured -- if using delta, check or Handlebars
delta.dateFieldin the URI{{{lastExportDateTime}}} - File parsing matches the format -- if file-based, matches the actual file format (csv, json, xml, xlsx, edi)
file.type - format is correct --
mockOutput, not a plain array{ "page_of_records": [{ "record": {...} }] } - No block --
rest:creates a legacy RESTExport. Use onlyrest:for new exportshttp: - Output filter syntax is valid -- if using an output filter expression, test it against sample data
- Lookup config is complete -- if , ensure response mapping is planned for the flow's
isLookup: trueentrypageProcessors[]
在创建或更新导出前,验证以下内容:
- 完全匹配——区分大小写,与适配器决策矩阵一致(例如
adaptorType,而非HTTPExport或httpExport)HttpExport - 已检查预构建连接器——对于HTTP导出,在编写任何手动前,
relativeURI未找到应用对应的连接器(或连接器缺少所需端点)celigo http-connectors list - 有效——指向现有且在线的正确类型连接。
_connectionId和WebhookExport无需此项SimpleExport - 存在适配器配置块——、
http{}、netsuite{}等与ftp{}匹配adaptorType - 或查询正确——错误的路径会静默返回0条记录且无错误
resourcePath - 已配置分页——对于HTTP导出,如果API返回分页结果,需设置
http.paging - 已配置增量同步——如果使用增量同步,检查或URI中的Handlebars
delta.dateField{{{lastExportDateTime}}} - 文件解析与格式匹配——如果是文件导出,与实际文件格式匹配(csv、json、xml、xlsx、edi)
file.type - 格式正确——格式为
mockOutput,而非普通数组{ "page_of_records": [{ "record": {...} }] } - 无块——
rest:会创建旧版RESTExport。新导出仅使用rest:http: - 输出过滤器语法有效——如果使用输出过滤器表达式,需针对样本数据测试
- 查找配置完整——如果,需确保流程的
isLookup: true项中已规划响应映射pageProcessors[]
Gotchas
常见陷阱
- PUT erases omitted fields. Always GET first, modify, then PUT. The command handles this.
set - Including a block creates a legacy RESTExport. Use only
rest:for new exports.http: - Wrong produces 0 records with no error. First thing to check when an export succeeds but returns nothing.
resourcePath - format is
mockOutput. Not a plain array.{ "page_of_records": [{ "record": {...} }] } - HTTP delta exports use Handlebars (in
{{{lastExportDateTime}}}), notrelativeURI.delta.dateField - NetSuite saved searches need . Use
netsuite.restlet.searchIdto find the search ID.celigo metadata types <connectionId> - File exports require the block. Without it, file-based exports return raw bytes instead of parsed records.
file{} - Webhook exports have no . Setting one causes validation errors.
_connectionId - Distributed exports require on the export AND
type: "distributed"on the connection.distributed: true - needs a dedicated, writeable tracking flag.
type: "once"must be writeable by the export's connection, and no other process may update the same field -- a shared flag causes records to be skipped.once.booleanField - An async-helper export cannot carry its own transform, output filter, or preSavePage hook. Build that processing into the helper's result export instead. The status and result exports must themselves be plain synchronous exports -- an async helper cannot nest another. See Async APIs (submit, poll, fetch).
- **PUT会删除未指定的字段。**始终先GET,修改后再PUT。命令会处理此问题。
set - **包含块会创建旧版RESTExport。**新导出仅使用
rest:http: - **错误的会返回0条记录且无错误。**当导出成功但未返回任何数据时,首先检查此项。
resourcePath - **格式为
mockOutput。**而非普通数组。{ "page_of_records": [{ "record": {...} }] } - HTTP增量导出使用Handlebars(中的
relativeURI),而非{{{lastExportDateTime}}}。delta.dateField - **NetSuite已保存搜索需要。**使用
netsuite.restlet.searchId查找搜索ID。celigo metadata types <connectionId> - **文件导出需要块。**没有它,文件导出会返回原始字节而非解析后的记录。
file{} - **Webhook导出无。**设置此项会导致验证错误。
_connectionId - 分布式导出需要在导出上设置,且在连接上设置
type: "distributed"。distributed: true - 需要专用的可写入跟踪标记。
type: "once"必须可被导出的连接写入,且其他进程不得更新同一字段——共享标记会导致记录被跳过。once.booleanField - **配置了异步助手的导出不能携带自己的转换、输出过滤器或preSavePage钩子。**将这些处理逻辑构建到助手的结果导出中。状态和结果导出本身必须是普通的同步导出——异步助手不能嵌套另一个异步助手。详见异步API(提交、轮询、获取)。
Common Errors
常见错误
| Error | Likely Cause | Fix |
|---|---|---|
| Wrong | Verify the endpoint path against the API docs; check for missing path parameters |
| Connection credentials expired or invalid | Run |
| Wrong | Check |
| Script assumes a field exists that is missing from some records | Add null checks: |
| Wrong format -- used array instead of object | Use |
| Case mismatch or typo | Use exact casing from the Adaptor Decision Matrix |
| Connection failed health check | Fix credentials, re-authorize, then |
| Too many concurrent requests to the source API | Lower |
| Query returns too much data or API is slow | Add pagination, narrow the date range, or increase timeout settings |
| | Verify |
| 错误 | 可能原因 | 修复方法 |
|---|---|---|
导出调用时出现 | | 根据API文档验证端点路径;检查是否缺少路径参数 |
| 连接凭证过期或无效 | 运行 |
| | 检查 |
preSavePage中出现 | 脚本假设存在某些记录中缺少的字段 | 添加空值检查:访问前先判断 |
| 格式错误——使用了数组而非对象 | 使用 |
| 大小写不匹配或拼写错误 | 使用适配器决策矩阵中的精确大小写 |
| 连接健康检查失败 | 修复凭证、重新授权,然后运行 |
| 对源API的并发请求过多 | 降低连接的 |
大型导出出现 | 查询返回数据过多或API响应缓慢 | 添加分页、缩小日期范围或增加超时设置 |
| | 验证 |