Overview
A package running under Orchestrate is an ordinary SSIS package. What makes it an Orchestrate package is the CX toolkit: one connection manager and a set of control-flow tasks that let the package talk to the platform. Through them the package learns which run it belongs to and what parameters that run carries, moves files in and out of the run folder, writes to the run's timeline, hands documents to CX Engine for composition and import, and assembles the PDFs that come back.
The toolkit is the only way a package reaches the platform. There are no connection strings to the run folder in a package, no API keys, and nothing that names a tenant. Everything a package needs to find its run is handed to it by the Scheduler at execution time, which is what lets the same package run safely in development, in test and in production.
Once the toolkit is installed on your workstation (see Checking out a project and setting up your workstation) the tasks appear in the SSIS Toolbox alongside the standard ones, each with a CX icon and its own editor. This guide describes what each one is for and how they fit together; the options that are particular to each task are listed in the CX task reference.
The CX Orchestrate connection manager
Every CX task uses a connection manager of type CX Orchestrate. It holds two things: the address of the run API and the run token that identifies the run the package is working for. In a project built from one of the templates the connection manager already exists, named CX Orchestrate, with both values bound by expression to project parameters:
ApiUrl = @[$Project::OrchestrateApiUrl]RunToken = @[$Project::RunToken]
The Scheduler sets those two parameters, together with RunId, on every execution. In Visual Studio they are empty, which is why a package validates cleanly on your workstation but a CX task will not execute until a token is supplied (see Running a package from Visual Studio). The RunToken project parameter must be marked Sensitive; the connection manager's editor reminds you of this.
The editor has one more setting, Authentication method, which decides how the file tasks sign in to the run folder's storage. Leave it at Default: on the integration runtime that is the runtime's managed identity, and on your workstation it is your Visual Studio sign-in. You can override it for your machine alone with the CX_ORCHESTRATE_STORAGE_CREDENTIAL environment variable, which the Dev setup page explains, without touching the package.
Quick tip
Each task has a CX Orchestrate connection property that names the connection manager to use. If a package has exactly one CX Orchestrate connection, a task that cannot find the name it was given uses that one and records a warning, so a renamed connection manager rarely breaks a package outright.
How the tasks fit together
Most packages follow the same outline, and the templates wire it for you:
- CX Get Run Parameters first, always. It reads the run's context once and fills the package variables everyone else relies on.
- Files in. A CX File Operation downloads the file a monitor detected or an operator uploaded; a CX Transfer File - Retrieve Remote fetches files from a registered location instead.
- Work. Data flows and Azure SQL Query tasks load the input into the project's staging database, apply rules and lookups, and shape the output. Assert tasks check the totals along the way.
- Files out. Anything the package writes locally is uploaded with CX File Operation and registered as an output; a file written straight into the run folder is registered the same way.
- Hand over. CX Batch - Import sends an output to CX Engine as an import, or CX Batch - Compose and Return sends a payload for composition and CX Batch - Wait for Compose waits for the documents.
- Finish the documents. CX Stitch PDFs, CX Split PDFs and CX Convert to PostScript turn composed PDFs into the print files you need, and CX Transfer File - Send Remote places them on an outbound location.
- Report. CX Update Counts and CX Raise Event keep the run page honest about what happened.
The control flow of the batch-compose template in Visual Studio, showing Get Run Parameters, the staging tasks and Request composition in order.
Not every package needs every step. An import-only project has no composition tasks; a project that never writes a file has no uploads. The order matters more than the count: context first, files registered before the run ends, and the hand-over to CX Engine last.
Run context and the timeline
CX Get Run Parameters
Reads the run once and writes what it finds into package variables, when the package has them: the run folder and its inputs/, outputs/ and work/ paths, the run id, the project name, the tenant code and the trigger kind. It also creates a scratch folder on the node for the package to work in (User::LocalWorkFolder) which the package is expected to remove when it finishes.
Its Parameters tab is where run parameters reach the package. Tick a variable and it is set from the run parameter of the same name, so a Period parameter on the project lands in User::Period. A ticked variable the package does not have fails validation, so you find out in the designer rather than on the runtime. The Access tokens tab does the same for Azure SQL tokens, which is how a package signs in to its staging database without a password (see Designing a solution).
For a project triggered by a file monitor, this task is also where the detected file arrives: as a single run-folder path in TriggerFile when the monitor batches per file, or as a table of files (TriggerFiles for pulled files, TriggerFileList for those left in place) when it batches per poll.
CX Raise Event
Writes one line to the run's timeline with a level (Progress, Info, Warning or Error), a message, a source and an optional count. Use it for the moments an operator will want to see: "Loaded 12,406 records", "No letters this period". An Error entry records the problem but does not fail the package by itself; fail the task or use an Assert for that. A retried task writes one line, not two.
CX Update Counts
Sets the figures the run page shows: records read and rejected, documents generated, submitted and delivered. The values are absolute, so a package can call it as often as it likes and a retry does no harm; a blank leaves that count as it was.
Assert
One exact check, named by the task's own name, so rename it to say what it checks ("Split PDFs = composed"). An input value is compared with an expected value, and each can be a query returning one value, a package variable, or a value typed into the task. With When it fails set to Error the task fails and stops the package; set to Warning it records a warning and carries on. The message it produces names both values, where each came from and the difference, and it can be written to the run's timeline so operators see it without opening the SSIS log.
Assert is a general task rather than a CX one. It needs the CX Orchestrate connection only when you ask it to write to the timeline.
Files
CX File Operation
The one task for everything that moves between the node and the run folder, with an Operation that says which, in the way SSIS's own File System Task works:
- Download single file and Download multiple files bring run-folder files onto the node, into your local work folder by default. The single-file form hands you the local path for a Flat File connection; the multiple-file form hands you a table for a Foreach loop.
- Upload single file and Upload multiple files send local files into the run folder and, by default, register each one as an output with its size and checksum.
- Register output records a file that is already in the run folder (written there directly by another task, say) so it appears on the run's Outputs tab and can be delivered or imported. Register input adds the package's own counts of documents, records and lines to a file it has read.
- List files and Delete files work on a folder or a pattern.
Every operation takes a Run-folder path: a file, a folder ending in /, or a pattern such as outputs/composition/*.pdf, written relative to the run folder or taken from a variable. Paths outside the run folder are refused, and a path variable that is empty at run time is an error rather than "everything". Every operation also writes the files it acted on into an Object variable as a table, which is the handoff to whatever comes next.
CX Transfer File - Retrieve Remote
Asks Orchestrate to copy files from a registered file location into the run folder's inputs/ and register them. The package names the location, a folder and a file pattern; the credentials stay with the platform. Use it when a project needs to collect files itself rather than wait for a monitor.
CX Transfer File - Send Remote
The reverse: pushes registered outputs, chosen by path or by a name pattern, to a registered outbound location. Delivery is idempotent per file and destination, so a retried package does not deliver twice unless you ask it to overwrite.
Data
Azure SQL Query
Runs a statement or stored procedure against a server and database, by default the project's staging server and database, signing in with an Azure SQL token so no password is stored anywhere. Parameters are mapped in a grid (@RunId = User::RunId) with input, output, in-out and return directions. What comes back is up to you: nothing but a rows-affected count, the first row into variables, every row into an Object variable for a Foreach loop, or an XML or CSV file written to the run folder, to the node, or both. The XML output is how most composing packages build their payload.
Like Assert, this is a general task with its own icon. It touches the CX Orchestrate connection only when it writes a file into the run folder.
CX Document Sequencer
A data-flow transform, not a control-flow task, for fixed-width files that carry several documents one after another. It reads a key at a fixed position in each line and adds a DocumentId and a LineNo column to every row, starting a new document when the key matches a header value or changes. The editor has a preview that runs the numbering over the first lines of a sample file.
Composition
CX Batch - Compose and Return
Sends a payload in the run folder to CX Engine's composition service and asks for one or more outputs: individual PDFs (one per record, delivered in a zip), a merged PDF, and PostScript for print, each with its own duplex, background-image and registration settings. The task names the CX Engine application whose template is used, the field in each record that identifies it and the one that names it, and what should happen when a single record fails to compose: fail the whole composition, or keep the records that composed and warn.
Every output comes with a record report (which record is on which pages) and a journal, which the later document tasks read to split, stitch and set print stock correctly. The task records the request in a table variable, User::CompositionRequests, that the waiting task reads. Calling it twice for the same payload returns the same request rather than composing twice; if that composition failed, the second call retries it.
CX Batch - Wait for Compose
Blocks until the run's compositions finish, all of them by default or only those in the requests table, and then reports the status, the summed record and sheet counts and, if asked, downloads the PDFs, PostScript and reports onto the node. A package usually requests several compositions and then waits once.
Documents
The three document tasks run in the tenant's document worker rather than on the node: the package requests an operation, waits for it (the default), and reads the counts from the result. Each takes its inputs as a table of run-folder paths or a manifest file, never a loose list, and each needs the journal of every PDF it touches so that the output's report and journal are right.
CX Stitch PDFs
Joins PDFs into one. A table joins whole files in order; a manifest can pick particular records out of each file by id, which is how a print file is assembled across several compositions. Padding can start each part on a new sheet for duplex printing.
CX Split PDFs
Cuts PDFs into one PDF per record, returned as a zip, with a name pattern ({RecordId}, {Name}, {Sequence} and so on) for the files inside. A manifest can select single records instead of cutting whole files.
CX Convert to PostScript
Turns a PDF into PostScript for print, injecting the stock and duplex commands from the PDF's journal. By default it refuses a PDF with no journal rather than produce PostScript with no media commands; switch Require journal off for a file that genuinely has none.
CX Engine
CX Batch - Import
Submits a registered output to CX Engine as an import, naming the channel and the CX Engine application's API code, with the option to hold the import for manual release. One call makes one import, so a package that splits its output by channel calls it once per file. A second call for the same file returns the import already made.
Options every task shares
- CX Orchestrate connection names the connection manager; the default is CX Orchestrate.
- FailPackageOnError (in the Properties window) is on by default. Off, a refusal from the platform becomes a warning and the package continues, which is occasionally what you want for a reporting step that must not stop a run.
- Any property that takes a number or a path also accepts a variable name, written
User::RowCountor@[User::RowCount]. - Anything a task returns as a table must go into an Object variable; anything it reads as a table accepts a DataTable or an ADO recordset, so a Foreach ADO enumerator can walk it.
- Every API call a task makes is written to the SSIS log with its URL, trace id, status and any retries. The run token itself is never logged.
A worked example: daily letters
A typical composing project runs like this, with each step a task from above:
- CX Get Run Parameters sets
User::Periodfrom the run'sPeriodparameter and fetches an Azure SQL token for the staging connection. - CX File Operation (Download single file) brings the monitored extract onto the node; a data flow with the CX Document Sequencer loads it into staging.
- Azure SQL Query tasks apply the business rules and write the payload XML into
process/in the run folder. - CX Batch - Compose and Return requests individual PDFs and a merged PDF; CX Batch - Wait for Compose waits.
- CX Stitch PDFs assembles the print file from a manifest the package builds with a
FOR XMLquery; CX Convert to PostScript turns it into PostScript with the right stock commands. - Assert compares the number of documents composed with the number split, and the sheets in the PostScript with the sheets in the journal.
- CX Update Counts records the totals and CX Transfer File - Send Remote delivers the print file.
Each stage leaves its evidence in the run folder, so an operator can open the run later and see the payload, the reports and the logs beside the outputs.
When you'd use this
- You are deciding how a new package should get its input file: a monitor with a download, or a fetch from a location.
- You want a total on the run page, or a check that fails the run when two totals disagree.
- You need to turn composed PDFs into print files and are choosing between stitch, split and convert.
- You are reading a template project and want to know what each CX task in it is doing.