Most batch import and export integrations can be added to workflows as part of a more advanced data pipeline. The basic steps are:
- Prepare a workflow definition, which is a YAML file, using the td_load> operator for an import integration and the td> operator for an export integration.
- Run the workflow on the TD Console, or from a command-line interface
If you have already created a Source for an import integration, you can run it in a workflow using its unique ID
Identify the target Source on the Integration Hub
Select the
**...**menu, and select Copy Unique ID
Define a workflow task using the td_load> operator.
+my_first_worklfow_step: td_load>: unique_id_of_your_source
Alternatively, you can provide all the parameters of the import connector in a YAML file, and refer to it in the workflow definition
Prepare a configuration file for your import integration, ex: load_config.yml. Examples and the full parameter explanation can be found in the document of each integration
Define a workflow refers to it
+my_first_workflow_step: td_load>: config/load_config.yml database: my_database_name table: my_table_name
There are a few ways to define a workflow task to query and upload the results to an export integration
Use the td> operator and the name of a pre-defined Authentication

+query_and_export: td>: queries/sample.sql database: my_database result_connection: ads_with_oauth result_settings: parameter1: value1 parameter2: value2 ....The parameter explanation can be found on each integration document, as the one below from the SFCC Export Integration

Use the td> operator and the ID of a pre-defined Authentication

+query_data_and_write_result_with_existing_authentication_by_url: td>: query: 'select * from wf_test' database: my_database result_url: '{"type": "google_adwords_v2", "td_authentication_id": 330392, "bucket": "qa-auto-test-3", "path": "viet/assume_role_from_eu01.csv"}'Use the td_run> operator and a saved query
+query_a_saved_sql: td_run>: presto_select_all_s3v2 database: my_database result_url: '{"type":"s3_v2", "td_authentication_id":260370, "bucket": "qqus-east-1", "path":"foo/wf_jan16_1444.csv"}'
There are two options to define and run a workflow
- Use the graphical interface on TD Console > Data Workbench > Workflows
- Use the command-line interface of TD Toolbelt
While using the TD Console is more straightforward than the command-line interface, the TD CLI tool offers options for more complex configurations.
Refer here for more details about the syntax and usages of the TD Workflow