{"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Regression test for script timeouts (CLO-37727). Two ExecuteScript components, interpreter /bin/bash, timeout 2000 ms:\n- 'Writes stdout until killed': an endless loop that prints 'line' to stdout and 'err' to stderr every 10 ms.\n- 'Silent sleep': sleep 10.\nSend each one's run-result port (port 1: stdOut, errOut, startTime, endTime, duration, exitValue, reachedTimeout, errException, errMessage; dates as yyyy-MM-dd HH:mm:ss) to its own Trash."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TRASH_CHATTY: discard\n- TRASH_SILENT: discard\n\nFlow:\n1. CHATTY: run a sh script, timeout 2000 ms \"Writes stdout until killed\"\n - out 1 → TRASH_CHATTY: discard\n2. SILENT: run a sh script, timeout 2000 ms \"Silent sleep\"\n - out 1 → TRASH_SILENT: discard\n\nRecords:\n- CHATTY → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n- SILENT → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TRASH_CHATTY: discard\n- TRASH_SILENT: discard\n\nFlow:\n1. CHATTY: exec script \"Writes stdout until killed\"\n - out 1 → TRASH_CHATTY: discard\n2. SILENT: run a sh script, timeout 2000 ms \"Silent sleep\"\n - out 1 → TRASH_SILENT: discard\n\nRecords:\n- CHATTY → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n- SILENT → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__clo-test__ExecuteScriptTimeout_CLO-37727.grf", "group": "clo-test", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Regression test for script timeouts (CLO-37727). Two ExecuteScript components, interpreter /bin/bash, timeout 2000 ms:\n- 'Writes stdout until killed': an endless loop that prints 'line' to stdout and 'err' to stderr every 10 ms.\n- 'Silent sleep': sleep 10.\nSend each one's run-result port (port 1: stdOut, errOut, startTime, endTime, duration, exitValue, reachedTimeout, errException, errMessage; dates as yyyy-MM-dd HH:mm:ss) to its own Trash."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TRASH_CHATTY: discard\n- TRASH_SILENT: discard\n\nFlow:\n1. CHATTY: run a sh script, timeout 2000 ms \"Writes stdout until killed\"\n - out 1 → TRASH_CHATTY: discard\n2. SILENT: run a sh script, timeout 2000 ms \"Silent sleep\"\n - out 1 → TRASH_SILENT: discard\n\nRecords:\n- CHATTY → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n- SILENT → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TRASH_CHATTY: discard\n- TRASH_SILENT: discard\n\nFlow:\n1. CHATTY: run a sh script, timeout 2000 ms \"Writes stdout until killed\"\n - out 1 → TRASH_CHATTY: discard\n2. SILENT: run a sh script, timeout 2000 ms \"Silent sleep\"\n - out 1 → TRASH_SILENT: discard\n\nRecords:\n- SILENT → RunResult: stdOut string, errOut string, startTime date, endTime date, duration long, exitValue long, reachedTimeout boolean, errException string, errMessage string\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__clo-test__ExecuteScriptTimeout_CLO-37727.grf", "group": "clo-test", "kind": "edge_meta_ref"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Child job for a per-retailer customer pipeline (the parent jobflow sets the parameters).\n\n- Read customers from parameter INPUT_FILE_URL (default ${DATAIN_DIR}/Retailers/LuxeMart/Customers.csv, metadata ${META_DIR}/Customer.fmt) with the controlled data policy. Write parse errors (metadata ${META_DIR}/FlatFileReader_Error.fmt) to ${ERROR_DIR}/Customer_errors.csv with a header; don't create the file when there are none.\n- Map to CustomerExtended (tab-delimited, CRLF, one header row; customerID long, customerName, city, state, stateName, region) from id, fullName, city and state.\n- Look up stateName and region from ${LOOKUP_DIR}/State_Region_Codes.csv (pipe-delimited: State, Code, Region) where state = Code. Keep customers without a match.\n- Write to parameter OUTPUT_FILE_URL (default ${DATAOUT_DIR}/Retailers/${CLIENT}/Customers_Extended.csv) with a header, creating directories.\n- INPUT_FILE_URL, OUTPUT_FILE_URL and CLIENT are public parameters.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n- OUTPUT: write ${OUTPUT_FILE_URL}\n\nFlow:\n1. INPUT: read ${INPUT_FILE_URL}\n - out 0 → MAP: map (CTL) → LOOKUP_STATES\n - out 1 (parse errors) → ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n2. REGIONS: read ${LOOKUP_DIR}/State_Region_Codes.csv → LOOKUP_STATES:1\n3. LOOKUP_STATES: left hash join on state = Code (CTL) → OUTPUT: write ${OUTPUT_FILE_URL}\n\nRecords:\n- INPUT → Customer: id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date, isActive boolean\n- INPUT → FlatFileReader_Error: recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- MAP: Customer → CustomerExtended: customerID long, customerName string, city string, state string, stateName string, region string\n- REGIONS → State_Region_Codes: State string, Code string, Region string\n\nNotes:\n- LOOKUP_STATES: hash join holds input 1 (REGIONS) in memory as the lookup side and streams input 0; no sorting needed.\n- LOOKUP_STATES: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: MAP.transform, LOOKUP_STATES.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n- OUTPUT: write ${OUTPUT_FILE_URL}\n\nFlow:\n1. INPUT: read ${INPUT_FILE_URL}\n - out 0 → MAP: map (CTL) → LOOKUP_STATES\n - out 1 (parse errors) → ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n2. REGIONS: read ${LOOKUP_DIR}/State_Region_Codes.csv → LOOKUP_STATES:1\n3. LOOKUP_STATES: left hash join on stat = Code (CTL) → OUTPUT: write ${OUTPUT_FILE_URL}\n\nRecords:\n- INPUT → Customer: id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date, isActive boolean\n- INPUT → FlatFileReader_Error: recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- MAP: Customer → CustomerExtended: customerID long, customerName string, city string, state string, stateName string, region string\n- REGIONS → State_Region_Codes: State string, Code string, Region string\n\nNotes:\n- LOOKUP_STATES: hash join holds input 1 (REGIONS) in memory as the lookup side and streams input 0; no sorting needed.\n- LOOKUP_STATES: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: MAP.transform, LOOKUP_STATES.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example3-Jobflow__Integration_Customers.grf", "group": "example3", "kind": "key_field"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Child job for a per-retailer customer pipeline (the parent jobflow sets the parameters).\n\n- Read customers from parameter INPUT_FILE_URL (default ${DATAIN_DIR}/Retailers/LuxeMart/Customers.csv, metadata ${META_DIR}/Customer.fmt) with the controlled data policy. Write parse errors (metadata ${META_DIR}/FlatFileReader_Error.fmt) to ${ERROR_DIR}/Customer_errors.csv with a header; don't create the file when there are none.\n- Map to CustomerExtended (tab-delimited, CRLF, one header row; customerID long, customerName, city, state, stateName, region) from id, fullName, city and state.\n- Look up stateName and region from ${LOOKUP_DIR}/State_Region_Codes.csv (pipe-delimited: State, Code, Region) where state = Code. Keep customers without a match.\n- Write to parameter OUTPUT_FILE_URL (default ${DATAOUT_DIR}/Retailers/${CLIENT}/Customers_Extended.csv) with a header, creating directories.\n- INPUT_FILE_URL, OUTPUT_FILE_URL and CLIENT are public parameters.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n- OUTPUT: write ${OUTPUT_FILE_URL}\n\nFlow:\n1. INPUT: read ${INPUT_FILE_URL}\n - out 0 → MAP: map (CTL) → LOOKUP_STATES\n - out 1 (parse errors) → ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n2. REGIONS: read ${LOOKUP_DIR}/State_Region_Codes.csv → LOOKUP_STATES:1\n3. LOOKUP_STATES: left hash join on state = Code (CTL) → OUTPUT: write ${OUTPUT_FILE_URL}\n\nRecords:\n- INPUT → Customer: id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date, isActive boolean\n- INPUT → FlatFileReader_Error: recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- MAP: Customer → CustomerExtended: customerID long, customerName string, city string, state string, stateName string, region string\n- REGIONS → State_Region_Codes: State string, Code string, Region string\n\nNotes:\n- LOOKUP_STATES: hash join holds input 1 (REGIONS) in memory as the lookup side and streams input 0; no sorting needed.\n- LOOKUP_STATES: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: MAP.transform, LOOKUP_STATES.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n- OUTPUT: write ${OUTPUT_FILE_URL}\n\nFlow:\n1. INPUT: file reader\n - out 0 → MAP: map (CTL) → LOOKUP_STATES\n - out 1 → ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n2. REGIONS: read ${LOOKUP_DIR}/State_Region_Codes.csv → LOOKUP_STATES:1\n3. LOOKUP_STATES: left hash join on state = Code (CTL) → OUTPUT: write ${OUTPUT_FILE_URL}\n\nRecords:\n- INPUT → Customer: id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date, isActive boolean\n- INPUT → FlatFileReader_Error: recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- MAP: Customer → CustomerExtended: customerID long, customerName string, city string, state string, stateName string, region string\n- REGIONS → State_Region_Codes: State string, Code string, Region string\n\nNotes:\n- LOOKUP_STATES: hash join holds input 1 (REGIONS) in memory as the lookup side and streams input 0; no sorting needed.\n- LOOKUP_STATES: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: MAP.transform, LOOKUP_STATES.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example3-Jobflow__Integration_Customers.grf", "group": "example3", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Child job for a per-retailer customer pipeline (the parent jobflow sets the parameters).\n\n- Read customers from parameter INPUT_FILE_URL (default ${DATAIN_DIR}/Retailers/LuxeMart/Customers.csv, metadata ${META_DIR}/Customer.fmt) with the controlled data policy. Write parse errors (metadata ${META_DIR}/FlatFileReader_Error.fmt) to ${ERROR_DIR}/Customer_errors.csv with a header; don't create the file when there are none.\n- Map to CustomerExtended (tab-delimited, CRLF, one header row; customerID long, customerName, city, state, stateName, region) from id, fullName, city and state.\n- Look up stateName and region from ${LOOKUP_DIR}/State_Region_Codes.csv (pipe-delimited: State, Code, Region) where state = Code. Keep customers without a match.\n- Write to parameter OUTPUT_FILE_URL (default ${DATAOUT_DIR}/Retailers/${CLIENT}/Customers_Extended.csv) with a header, creating directories.\n- INPUT_FILE_URL, OUTPUT_FILE_URL and CLIENT are public parameters.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n- OUTPUT: write ${OUTPUT_FILE_URL}\n\nFlow:\n1. INPUT: read ${INPUT_FILE_URL}\n - out 0 → MAP: map (CTL) → LOOKUP_STATES\n - out 1 (parse errors) → ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n2. REGIONS: read ${LOOKUP_DIR}/State_Region_Codes.csv → LOOKUP_STATES:1\n3. LOOKUP_STATES: left hash join on state = Code (CTL) → OUTPUT: write ${OUTPUT_FILE_URL}\n\nRecords:\n- INPUT → Customer: id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date, isActive boolean\n- INPUT → FlatFileReader_Error: recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- MAP: Customer → CustomerExtended: customerID long, customerName string, city string, state string, stateName string, region string\n- REGIONS → State_Region_Codes: State string, Code string, Region string\n\nNotes:\n- LOOKUP_STATES: hash join holds input 1 (REGIONS) in memory as the lookup side and streams input 0; no sorting needed.\n- LOOKUP_STATES: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: MAP.transform, LOOKUP_STATES.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n- OUTPUT: write ${OUTPUT_FILE_URL}\n\nFlow:\n1. INPUT: read ${INPUT_FILE_URL}\n - out 0 → MAP: map (CTL) → LOOKUP_STATES\n - out 1 (parse errors) → ERRORS: write ${ERROR_DIR}/Customer_errors.csv\n2. REGIONS: read ${LOOKUP_DIR}/State_Region_Codes.csv → LOOKUP_STATES:1\n3. LOOKUP_STATES: left hash join on state = Code (CTL) → OUTPUT: write ${OUTPUT_FILE_URL}\n\nRecords:\n- INPUT → FlatFileReader_Error: recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- MAP: Metadata1_v2 → CustomerExtended: +customerID long, +customerName string, +city string, +state string, +stateName string, +region string\n- REGIONS → State_Region_Codes: State string, Code string, Region string\n\nNotes:\n- LOOKUP_STATES: hash join holds input 1 (REGIONS) in memory as the lookup side and streams input 0; no sorting needed.\n- LOOKUP_STATES: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: MAP.transform, LOOKUP_STATES.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example3-Jobflow__Integration_Customers.grf", "group": "example3", "kind": "edge_meta_ref"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "CTL runtime contract probe P901. Generate 8 records, case_id 1..8. raw_date is '2025-02-30' for odd cases and '2025-1-1' for even ones. For each record:\n- decimal_threw / decimal_null: whether str2decimal(\"\") throws a CTLException or returns null\n- is_date: isDate(raw_date, 'yyyy-MM-dd', 'en.US', 'UTC', strict)\n- parse strictly with str2date and the same pattern; on success parsed_date = the date as 'yyyy-MM-dd HH:mm:ss' (UTC), on failure parse_threw = true and parsed_date null\n- unicode_length = length(\"A😀\")\nEncode all fields to text and write suite_v5/data-out/P901_out_0.csv (pipe-delimited, quoted, __NULL__ for null, en.US; overwrite, create dirs, create empty files)."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write suite_v5/data-out/P901_out_0.csv\n\nFlow:\n1. Test: generate 8 records (CTL) → Encode0: map (CTL) → Writer0: write suite_v5/data-out/P901_out_0.csv\n\nRecords:\n- Test → ConversionProbe: case_id integer, raw_date string, decimal_threw boolean, decimal_null boolean, is_date boolean, parse_threw boolean, parsed_date string, unicode_length integer\n- Encode0: ConversionProbe → RawOutput0: ~case_id integer→string, ~decimal_threw boolean→string, ~decimal_null boolean→string, ~is_date boolean→string, ~parse_threw boolean→string, ~unicode_length integer→string\n\nCTL: Test.generate, Encode0.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write suite_v5/data-out/P901_out_0.csv\n\nFlow:\n1. Test: generate 8 records (CTL) → Encode0: map (CTL) → Writer0: write suite_v5/data-out/P901_out_0.csv\n\nRecords:\n- Encode0 → RawOutput0: case_id string, raw_date string, decimal_threw string, decimal_null string, is_date string, parse_threw string, parsed_date string, unicode_length string\n\nCTL: Test.generate, Encode0.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "suite_v5__graph__P901.grf", "group": "suite_v5", "kind": "edge_meta_missing"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "CTL runtime contract probe P901. Generate 8 records, case_id 1..8. raw_date is '2025-02-30' for odd cases and '2025-1-1' for even ones. For each record:\n- decimal_threw / decimal_null: whether str2decimal(\"\") throws a CTLException or returns null\n- is_date: isDate(raw_date, 'yyyy-MM-dd', 'en.US', 'UTC', strict)\n- parse strictly with str2date and the same pattern; on success parsed_date = the date as 'yyyy-MM-dd HH:mm:ss' (UTC), on failure parse_threw = true and parsed_date null\n- unicode_length = length(\"A😀\")\nEncode all fields to text and write suite_v5/data-out/P901_out_0.csv (pipe-delimited, quoted, __NULL__ for null, en.US; overwrite, create dirs, create empty files)."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write suite_v5/data-out/P901_out_0.csv\n\nFlow:\n1. Test: generate 8 records (CTL) → Encode0: map (CTL) → Writer0: write suite_v5/data-out/P901_out_0.csv\n\nRecords:\n- Test → ConversionProbe: case_id integer, raw_date string, decimal_threw boolean, decimal_null boolean, is_date boolean, parse_threw boolean, parsed_date string, unicode_length integer\n- Encode0: ConversionProbe → RawOutput0: ~case_id integer→string, ~decimal_threw boolean→string, ~decimal_null boolean→string, ~is_date boolean→string, ~parse_threw boolean→string, ~unicode_length integer→string\n\nCTL: Test.generate, Encode0.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write suite_v5/data-out/P901_out_0.csv\n\nFlow:\n1. Test: generate 8 records (CTL) → Encode0: map (CTL) → Writer0: write suite_v5/data-out/P901_out_0.csv\n\nRecords:\n- Test → ConversionProbe: case_id integer, raw_date string, decimal_threw boolean, decimal_null boolean, is_date boolean, parse_threw boolean, parsed_date string, unicode_length integer\n- Encode0: ConversionProbe → RawOutput0: ~case_id integer→string, ~decimal_threw boolean→string, ~decimal_null boolean→string, ~is_date boolean→string, ~parse_threw boolean→string, ~unicode_length integer→string\n\nCTL: Test.generate, Encode0.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "suite_v5__graph__P901.grf", "group": "suite_v5", "kind": "ctl_field"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "CTL runtime contract probe P901. Generate 8 records, case_id 1..8. raw_date is '2025-02-30' for odd cases and '2025-1-1' for even ones. For each record:\n- decimal_threw / decimal_null: whether str2decimal(\"\") throws a CTLException or returns null\n- is_date: isDate(raw_date, 'yyyy-MM-dd', 'en.US', 'UTC', strict)\n- parse strictly with str2date and the same pattern; on success parsed_date = the date as 'yyyy-MM-dd HH:mm:ss' (UTC), on failure parse_threw = true and parsed_date null\n- unicode_length = length(\"A😀\")\nEncode all fields to text and write suite_v5/data-out/P901_out_0.csv (pipe-delimited, quoted, __NULL__ for null, en.US; overwrite, create dirs, create empty files)."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write suite_v5/data-out/P901_out_0.csv\n\nFlow:\n1. Test: generate 8 records (CTL) → Encode0: map (CTL) → Writer0: write suite_v5/data-out/P901_out_0.csv\n\nRecords:\n- Test → ConversionProbe: case_id integer, raw_date string, decimal_threw boolean, decimal_null boolean, is_date boolean, parse_threw boolean, parsed_date string, unicode_length integer\n- Encode0: ConversionProbe → RawOutput0: ~case_id integer→string, ~decimal_threw boolean→string, ~decimal_null boolean→string, ~is_date boolean→string, ~parse_threw boolean→string, ~unicode_length integer→string\n\nCTL: Test.generate, Encode0.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write suite_v5/data-out/P901_out_0.csv\n\nFlow:\n1. Test: generator (CTL) → Encode0: map (CTL) → Writer0: write suite_v5/data-out/P901_out_0.csv\n\nRecords:\n- Test → ConversionProbe: case_id integer, raw_date string, decimal_threw boolean, decimal_null boolean, is_date boolean, parse_threw boolean, parsed_date string, unicode_length integer\n- Encode0: ConversionProbe → RawOutput0: ~case_id integer→string, ~decimal_threw boolean→string, ~decimal_null boolean→string, ~is_date boolean→string, ~parse_threw boolean→string, ~unicode_length integer→string\n\nCTL: Test.generate, Encode0.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "suite_v5__graph__P901.grf", "group": "suite_v5", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Download the national flag of the country this server is in, and store it in data-out.\n\n1. Call https://ipapi.co/json/ with an HTTP connector. If the status isn't 200, fail the job with the error message.\n2. Parse the JSON body (schema ${META_DIR}/ip_json) into an ipInfo record holding every ipapi field as a string (ip, network, version, city, region, region_code, country, country_name, country_code, country_code_iso3, country_capital, country_tld, continent_code, in_eu, postal, latitude, longitude, timezone, utc_offset, country_calling_code, currency, currency_name, languages, country_area, country_population, asn, org).\n3. Use a REST connector with the OpenAPI spec ${DATAIN_DIR}/restCountriesOPENAPI.yaml (root https://restcountries.com/v3.1, GET /alpha/{code}, code = country_code). From the 200 response map cca2 and flags.png into a flagInfo record. Send error responses to a Fail component with their error message.\n4. Download the PNG with another HTTP connector to ${DATAOUT_DIR}/_flag.png. On a non-200 status fail; otherwise end in Success with the message 'Flag downloaded and store as '.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- ${META_DIR}/ip_json: (schema file)"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n- SUCCESS1: end the job successfully with a message (CTL)\n\nFlow:\n1. HTTPCONNECTOR: HTTP request https://ipapi.co/json/ → CHECK_STATUS: filter (CTL)\n - out 0 (accepted) → PARSE_RESPONSE: parse JSON from input field content → RESTCONNECTOR: REST GET https://restcountries.com/v3.1/alpha/{code} (CTL)\n - out 0 → ANOTHER_HTTPCONNECTOR: HTTP request (URL from input) (CTL) → CHECK_STATUS1: filter (CTL)\n - out 0 (accepted) → SUCCESS1: end the job successfully with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n - out 1 → STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n\nRecords:\n- PARSE_RESPONSE → ipInfo: ip string, network string, version string, city string, region string, region_code string, country string, country_name string, country_code string, country_code_iso3 string, country_capital string, country_tld string, continent_code string, in_eu string, postal string, latitude string, longitude string, timezone string, utc_offset string, country_calling_code string, currency string, currency_name string, languages string, country_area string, country_population string, asn string, org string\n- RESTCONNECTOR: ipInfo → flagInfo: cca2 string, png string\n- RESTCONNECTOR: ipInfo → response: content string, contentByte byte, contentJson variant, statusCode integer, responseHeaders string, errorMessage string\n\nCTL: CHECK_STATUS.filterExpression, RESTCONNECTOR.defaultOutputMapping, RESTCONNECTOR.inputMapping, ANOTHER_HTTPCONNECTOR.inputMapping, CHECK_STATUS1.filterExpression, STATUS_NOT_200_ERROR.mapping, STATUS_NOT_200_ERROR1.mapping, STATUS_NOT_200_ERROR3.mapping, SUCCESS1.mapping\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\n\n]]>\n \n \n \n \n \n \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n- SUCCESS1: end the job successfully with a message (CTL)\n\nFlow:\n1. HTTPCONNECTOR: HTTP request https://ipapi.co/json/ → CHECK_STATUS: filter (CTL)\n - out 0 (accepted) → PARSE_RESPONSE: parse JSON from input field content → RESTCONNECTOR: REST GET https://restcountries.com/v3.1/alpha/{code} (CTL)\n - out 0 → ANOTHER_HTTPCONNECTOR: HTTP request (URL from input) (CTL) → CHECK_STATUS1: filter (CTL)\n - out 0 (accepted) → SUCCESS1: end the job successfully with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n - out 1 → STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n\nRecords:\n- RESTCONNECTOR: Metadata0_v2 → flagInfo: +cca2 string, +png string\n- RESTCONNECTOR: Metadata0_v2 → response: +content string, +contentByte byte, +contentJson variant, +statusCode integer, +responseHeaders string, +errorMessage string\n\nCTL: CHECK_STATUS.filterExpression, RESTCONNECTOR.defaultOutputMapping, RESTCONNECTOR.inputMapping, ANOTHER_HTTPCONNECTOR.inputMapping, CHECK_STATUS1.filterExpression, STATUS_NOT_200_ERROR.mapping, STATUS_NOT_200_ERROR1.mapping, STATUS_NOT_200_ERROR3.mapping, SUCCESS1.mapping\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\n\n]]>\n \n \n \n \n \n \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example2-REST-API__RestApiExample.grf", "group": "example2", "kind": "edge_meta_ref"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Download the national flag of the country this server is in, and store it in data-out.\n\n1. Call https://ipapi.co/json/ with an HTTP connector. If the status isn't 200, fail the job with the error message.\n2. Parse the JSON body (schema ${META_DIR}/ip_json) into an ipInfo record holding every ipapi field as a string (ip, network, version, city, region, region_code, country, country_name, country_code, country_code_iso3, country_capital, country_tld, continent_code, in_eu, postal, latitude, longitude, timezone, utc_offset, country_calling_code, currency, currency_name, languages, country_area, country_population, asn, org).\n3. Use a REST connector with the OpenAPI spec ${DATAIN_DIR}/restCountriesOPENAPI.yaml (root https://restcountries.com/v3.1, GET /alpha/{code}, code = country_code). From the 200 response map cca2 and flags.png into a flagInfo record. Send error responses to a Fail component with their error message.\n4. Download the PNG with another HTTP connector to ${DATAOUT_DIR}/_flag.png. On a non-200 status fail; otherwise end in Success with the message 'Flag downloaded and store as '.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- ${META_DIR}/ip_json: (schema file)"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n- SUCCESS1: end the job successfully with a message (CTL)\n\nFlow:\n1. HTTPCONNECTOR: HTTP request https://ipapi.co/json/ → CHECK_STATUS: filter (CTL)\n - out 0 (accepted) → PARSE_RESPONSE: parse JSON from input field content → RESTCONNECTOR: REST GET https://restcountries.com/v3.1/alpha/{code} (CTL)\n - out 0 → ANOTHER_HTTPCONNECTOR: HTTP request (URL from input) (CTL) → CHECK_STATUS1: filter (CTL)\n - out 0 (accepted) → SUCCESS1: end the job successfully with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n - out 1 → STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n\nRecords:\n- PARSE_RESPONSE → ipInfo: ip string, network string, version string, city string, region string, region_code string, country string, country_name string, country_code string, country_code_iso3 string, country_capital string, country_tld string, continent_code string, in_eu string, postal string, latitude string, longitude string, timezone string, utc_offset string, country_calling_code string, currency string, currency_name string, languages string, country_area string, country_population string, asn string, org string\n- RESTCONNECTOR: ipInfo → flagInfo: cca2 string, png string\n- RESTCONNECTOR: ipInfo → response: content string, contentByte byte, contentJson variant, statusCode integer, responseHeaders string, errorMessage string\n\nCTL: CHECK_STATUS.filterExpression, RESTCONNECTOR.defaultOutputMapping, RESTCONNECTOR.inputMapping, ANOTHER_HTTPCONNECTOR.inputMapping, CHECK_STATUS1.filterExpression, STATUS_NOT_200_ERROR.mapping, STATUS_NOT_200_ERROR1.mapping, STATUS_NOT_200_ERROR3.mapping, SUCCESS1.mapping\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\n\n]]>\n \n \n \n \n \n \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n- SUCCESS1: end the job successfully with a message (CTL)\n\nFlow:\n1. HTTPCONNECTOR: HTTP request https://ipapi.co/json/ → CHECK_STATUS: filter (CTL)\n - out 0 (accepted) → PARSE_RESPONSE: parse JSON from input field content → RESTCONNECTOR: REST GET https://restcountries.com/v3.1/alpha/{code} (CTL)\n - out 0 → ANOTHER_HTTPCONNECTOR: HTTP request (URL from input) (CTL) → CHECK_STATUS1: filter (CTL)\n - out 0 (accepted) → SUCCESS1: end the job successfully with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n - out 1 → STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n\nRecords:\n- PARSE_RESPONSE → ipInfo: ip string, network string, version string, city string, region string, region_code string, country string, country_name string, country_code string, country_code_iso3 string, country_capital string, country_tld string, continent_code string, in_eu string, postal string, latitude string, longitude string, timezone string, utc_offset string, country_calling_code string, currency string, currency_name string, languages string, country_area string, country_population string, asn string, org string\n- RESTCONNECTOR: ipInfo → flagInfo: cca2 string, png string\n- RESTCONNECTOR: ipInfo → response: content string, contentByte byte, contentJson variant, statusCode integer, responseHeaders string, errorMessage string\n\nCTL: CHECK_STATUS.filterExpression, RESTCONNECTOR.defaultOutputMapping, RESTCONNECTOR.inputMapping, ANOTHER_HTTPCONNECTOR.inputMapping, CHECK_STATUS1.filterExpression, STATUS_NOT_200_ERROR.mapping, STATUS_NOT_200_ERROR1.mapping, STATUS_NOT_200_ERROR3.mapping, SUCCESS1.mapping\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\n\n]]>\n \n \n \n \n \n \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example2-REST-API__RestApiExample.grf", "group": "example2", "kind": "ctl_field"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Download the national flag of the country this server is in, and store it in data-out.\n\n1. Call https://ipapi.co/json/ with an HTTP connector. If the status isn't 200, fail the job with the error message.\n2. Parse the JSON body (schema ${META_DIR}/ip_json) into an ipInfo record holding every ipapi field as a string (ip, network, version, city, region, region_code, country, country_name, country_code, country_code_iso3, country_capital, country_tld, continent_code, in_eu, postal, latitude, longitude, timezone, utc_offset, country_calling_code, currency, currency_name, languages, country_area, country_population, asn, org).\n3. Use a REST connector with the OpenAPI spec ${DATAIN_DIR}/restCountriesOPENAPI.yaml (root https://restcountries.com/v3.1, GET /alpha/{code}, code = country_code). From the 200 response map cca2 and flags.png into a flagInfo record. Send error responses to a Fail component with their error message.\n4. Download the PNG with another HTTP connector to ${DATAOUT_DIR}/_flag.png. On a non-200 status fail; otherwise end in Success with the message 'Flag downloaded and store as '.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- ${META_DIR}/ip_json: (schema file)"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n- SUCCESS1: end the job successfully with a message (CTL)\n\nFlow:\n1. HTTPCONNECTOR: HTTP request https://ipapi.co/json/ → CHECK_STATUS: filter (CTL)\n - out 0 (accepted) → PARSE_RESPONSE: parse JSON from input field content → RESTCONNECTOR: REST GET https://restcountries.com/v3.1/alpha/{code} (CTL)\n - out 0 → ANOTHER_HTTPCONNECTOR: HTTP request (URL from input) (CTL) → CHECK_STATUS1: filter (CTL)\n - out 0 (accepted) → SUCCESS1: end the job successfully with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n - out 1 → STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n\nRecords:\n- PARSE_RESPONSE → ipInfo: ip string, network string, version string, city string, region string, region_code string, country string, country_name string, country_code string, country_code_iso3 string, country_capital string, country_tld string, continent_code string, in_eu string, postal string, latitude string, longitude string, timezone string, utc_offset string, country_calling_code string, currency string, currency_name string, languages string, country_area string, country_population string, asn string, org string\n- RESTCONNECTOR: ipInfo → flagInfo: cca2 string, png string\n- RESTCONNECTOR: ipInfo → response: content string, contentByte byte, contentJson variant, statusCode integer, responseHeaders string, errorMessage string\n\nCTL: CHECK_STATUS.filterExpression, RESTCONNECTOR.defaultOutputMapping, RESTCONNECTOR.inputMapping, ANOTHER_HTTPCONNECTOR.inputMapping, CHECK_STATUS1.filterExpression, STATUS_NOT_200_ERROR.mapping, STATUS_NOT_200_ERROR1.mapping, STATUS_NOT_200_ERROR3.mapping, SUCCESS1.mapping\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\n\n]]>\n \n \n \n \n \n \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n- STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n- SUCCESS1: end the job successfully with a message (CTL)\n\nFlow:\n1. HTTPCONNECTOR: http client → CHECK_STATUS: filter (CTL)\n - out 0 (accepted) → PARSE_RESPONSE: parse JSON from input field content → RESTCONNECTOR: REST GET https://restcountries.com/v3.1/alpha/{code} (CTL)\n - out 0 → ANOTHER_HTTPCONNECTOR: HTTP request (URL from input) (CTL) → CHECK_STATUS1: filter (CTL)\n - out 0 (accepted) → SUCCESS1: end the job successfully with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR: fail the job with a message (CTL)\n - out 1 → STATUS_NOT_200_ERROR3: fail the job with a message (CTL)\n - out 1 (rejected) → STATUS_NOT_200_ERROR1: fail the job with a message (CTL)\n\nRecords:\n- PARSE_RESPONSE → ipInfo: ip string, network string, version string, city string, region string, region_code string, country string, country_name string, country_code string, country_code_iso3 string, country_capital string, country_tld string, continent_code string, in_eu string, postal string, latitude string, longitude string, timezone string, utc_offset string, country_calling_code string, currency string, currency_name string, languages string, country_area string, country_population string, asn string, org string\n- RESTCONNECTOR: ipInfo → flagInfo: cca2 string, png string\n- RESTCONNECTOR: ipInfo → response: content string, contentByte byte, contentJson variant, statusCode integer, responseHeaders string, errorMessage string\n\nCTL: CHECK_STATUS.filterExpression, RESTCONNECTOR.defaultOutputMapping, RESTCONNECTOR.inputMapping, ANOTHER_HTTPCONNECTOR.inputMapping, CHECK_STATUS1.filterExpression, STATUS_NOT_200_ERROR.mapping, STATUS_NOT_200_ERROR1.mapping, STATUS_NOT_200_ERROR3.mapping, SUCCESS1.mapping\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\n\t\n\n]]>\n \n \n \n \n \n \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example2-REST-API__RestApiExample.grf", "group": "example2", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Build a graph that finds our top 20 spending customers.\n\nInputs:\n- customers: ${DATAIN_DIR}/customers.csv, semicolon-delimited with a header row: Id (integer), LastName, FirstName.\n- transactions: ${DATAIN_DIR}/transactions.csv, fixed-width, metadata ${META_DIR}/Transactions.fmt.\n- exchange rates: the ECB daily XML at graph parameter RATES_FILE (default https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml). The rates are the innermost Cube elements (currency, rate with 5 decimals). They have no numeric id: number them 0, 1, 2 ... in reading order, because a transaction's CurrencyId is that position.\n\nSteps:\n1. Sort transactions by CustomerId and left-join them to customers with a merge join (CustomerId = Id).\n2. Left-join the result to the rates on currency id. amount_euro = amount / rate, falling back to the original amount if the division fails. original_currency is the rate's currency code, or the numeric id as text when there's no rate.\n3. Route: no customer -> sheet 'missing-customers'; currency still numeric (not resolved) -> sheet 'missing-currency'; everything else continues.\n4. Sum amount_euro per customer (keep first/last name, currency '€'), sort by amount descending, keep the first 20.\n5. Write the top 20 to sheet 'top-20-customers' and to ${DATAOUT_DIR}/top-20-customers.html as a table with columns Customer, Amount, Currency, Full Name.\n\nAll three sheets are in ${DATAOUT_DIR}/reports.xlsx, so write them in separate phases.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n- TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n- MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n- MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n\nFlow:\n1. LOAD_CUSTOMER_DETAILS: read ${DATAIN_DIR}/customers.csv → MATCH_TRANSACTIONS_WITH_CUSTOMER:1\n2. LOAD_ONLINE_EXCHANGE_RATES1: read XML ${RATES_FILE} → FORMAT_FIELDS: map (CTL) → CONVERT_CURRENCY_TO_EURO:1\n3. LOAD_TRANSACTIONS: read ${DATAIN_DIR}/transactions.csv → SORT_TRANSACTIONS: sort by CustomerId asc → MATCH_TRANSACTIONS_WITH_CUSTOMER\n4. MATCH_TRANSACTIONS_WITH_CUSTOMER: left merge join on CustomerId = Id (CTL) → CONVERT_CURRENCY_TO_EURO\n5. CONVERT_CURRENCY_TO_EURO: left hash join on currency = id (CTL) → ROUTE_RECORDS_BY_LOGIC: route (CTL)\n - out 0 → MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n - out 1 → MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n - out 2 → SUM_TRANSACTIONS_BY_CUSTOMER: aggregate per customer_id: customer_last_name = first(customer_last_name), customer_first_name = first(customer_first_name), amount = sum(amount_euro) → SORT_BY_AMOUNT_DESCENDING: sort by amount desc → GET_TOP_20: keep the first 20 records → SIMPLE_COPY: copy to 2 outputs\n - out 0 → TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n - out 1 → TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n\nRecords:\n- LOAD_CUSTOMER_DETAILS → Customers: Id integer, LastName string, FirstName string\n- LOAD_ONLINE_EXCHANGE_RATES1 → rates: currency string, rate decimal\n- FORMAT_FIELDS: rates → rates_with_id: +id integer\n- LOAD_TRANSACTIONS → Transactions: TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: Transactions + Customers → transaction_joined: customer_id integer, customer_last_name string, customer_first_name string, transaction_id integer, amount decimal, currency integer\n- CONVERT_CURRENCY_TO_EURO: transaction_joined + rates_with_id → transaction_with_currency: +original_currency string, +original_currency_id integer, +amount_euro decimal, -amount, -currency, -rate, -id\n- SUM_TRANSACTIONS_BY_CUSTOMER: transaction_with_currency → transactions_summed: customer_id integer, customer_last_name string, customer_first_name string, amount decimal, currency string\n\nNotes:\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: a merge join needs inputs sorted on the key: input 0 by CustomerId (sorted by SORT_TRANSACTIONS on CustomerId asc); input 1 by Id (no sort upstream: assumes LOAD_CUSTOMER_DETAILS delivers it sorted).\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: left join keeps input 0 records without a match; input 1 fields are null for them.\n- CONVERT_CURRENCY_TO_EURO: hash join holds input 1 (FORMAT_FIELDS) in memory as the lookup side and streams input 0; no sorting needed.\n- CONVERT_CURRENCY_TO_EURO: left join keeps input 0 records without a match; input 1 fields are null for them.\n- SUM_TRANSACTIONS_BY_CUSTOMER: a sorted aggregate needs inputs sorted on the key: input 0 by customer_id (sorted by SORT_TRANSACTIONS on CustomerId asc, order kept downstream).\n- GET_TOP_20: SORT_BY_AMOUNT_DESCENDING sorts by amount desc, so keeping the first 20 records is a top 20.\n- SIMPLE_COPY: every record goes to both outputs.\n- TOP_20_CUSTOMERS_AS_SPREADSHEET, MISSING_CUSTOMERS, MISSING_CURRENCY all write ${DATAOUT_DIR}/reports.xlsx, so each runs in its own phase (0, 1, 2).\n\nPhases:\n- 0: all other nodes\n- 1: MISSING_CUSTOMERS\n- 2: MISSING_CURRENCY\n\nCTL: FORMAT_FIELDS.transform, MATCH_TRANSACTIONS_WITH_CUSTOMER.transform, CONVERT_CURRENCY_TO_EURO.transform, ROUTE_RECORDS_BY_LOGIC.partitionSource\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n- TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n- MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n- MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n\nFlow:\n1. LOAD_CUSTOMER_DETAILS: read ${DATAIN_DIR}/customers.csv → MATCH_TRANSACTIONS_WITH_CUSTOMER:1\n2. LOAD_ONLINE_EXCHANGE_RATES1: read XML ${RATES_FILE} → FORMAT_FIELDS: map (CTL) → CONVERT_CURRENCY_TO_EURO:1\n3. LOAD_TRANSACTIONS: read ${DATAIN_DIR}/transactions.csv → SORT_TRANSACTIONS: sort by customer_id asc → MATCH_TRANSACTIONS_WITH_CUSTOMER\n4. MATCH_TRANSACTIONS_WITH_CUSTOMER: left merge join on CustomerId = Id (CTL) → CONVERT_CURRENCY_TO_EURO\n5. CONVERT_CURRENCY_TO_EURO: left hash join on currency = id (CTL) → ROUTE_RECORDS_BY_LOGIC: route (CTL)\n - out 0 → MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n - out 1 → MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n - out 2 → SUM_TRANSACTIONS_BY_CUSTOMER: aggregate per customer_id: customer_last_name = first(customer_last_name), customer_first_name = first(customer_first_name), amount = sum(amount_euro) → SORT_BY_AMOUNT_DESCENDING: sort by amount desc → GET_TOP_20: keep the first 20 records → SIMPLE_COPY: copy to 2 outputs\n - out 0 → TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n - out 1 → TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n\nRecords:\n- LOAD_CUSTOMER_DETAILS → Customers: Id integer, LastName string, FirstName string\n- LOAD_ONLINE_EXCHANGE_RATES1 → rates: currency string, rate decimal\n- FORMAT_FIELDS: rates → rates_with_id: +id integer\n- LOAD_TRANSACTIONS → Transactions: TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: Transactions + Customers → transaction_joined: customer_id integer, customer_last_name string, customer_first_name string, transaction_id integer, amount decimal, currency integer\n- CONVERT_CURRENCY_TO_EURO: transaction_joined + rates_with_id → transaction_with_currency: +original_currency string, +original_currency_id integer, +amount_euro decimal, -amount, -currency, -rate, -id\n- SUM_TRANSACTIONS_BY_CUSTOMER: transaction_with_currency → transactions_summed: customer_id integer, customer_last_name string, customer_first_name string, amount decimal, currency string\n\nNotes:\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: a merge join needs inputs sorted on the key: input 0 by CustomerId (sorted by SORT_TRANSACTIONS on customer_id asc); input 1 by Id (no sort upstream: assumes LOAD_CUSTOMER_DETAILS delivers it sorted).\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: left join keeps input 0 records without a match; input 1 fields are null for them.\n- CONVERT_CURRENCY_TO_EURO: hash join holds input 1 (FORMAT_FIELDS) in memory as the lookup side and streams input 0; no sorting needed.\n- CONVERT_CURRENCY_TO_EURO: left join keeps input 0 records without a match; input 1 fields are null for them.\n- SUM_TRANSACTIONS_BY_CUSTOMER: a sorted aggregate needs inputs sorted on the key: input 0 by customer_id (sorted by SORT_TRANSACTIONS on customer_id asc, order kept downstream).\n- GET_TOP_20: SORT_BY_AMOUNT_DESCENDING sorts by amount desc, so keeping the first 20 records is a top 20.\n- SIMPLE_COPY: every record goes to both outputs.\n- TOP_20_CUSTOMERS_AS_SPREADSHEET, MISSING_CUSTOMERS, MISSING_CURRENCY all write ${DATAOUT_DIR}/reports.xlsx, so each runs in its own phase (0, 1, 2).\n\nPhases:\n- 0: all other nodes\n- 1: MISSING_CUSTOMERS\n- 2: MISSING_CURRENCY\n\nCTL: FORMAT_FIELDS.transform, MATCH_TRANSACTIONS_WITH_CUSTOMER.transform, CONVERT_CURRENCY_TO_EURO.transform, ROUTE_RECORDS_BY_LOGIC.partitionSource\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example1-TopCustomers__TopCustomers.grf", "group": "example1", "kind": "key_field"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Build a graph that finds our top 20 spending customers.\n\nInputs:\n- customers: ${DATAIN_DIR}/customers.csv, semicolon-delimited with a header row: Id (integer), LastName, FirstName.\n- transactions: ${DATAIN_DIR}/transactions.csv, fixed-width, metadata ${META_DIR}/Transactions.fmt.\n- exchange rates: the ECB daily XML at graph parameter RATES_FILE (default https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml). The rates are the innermost Cube elements (currency, rate with 5 decimals). They have no numeric id: number them 0, 1, 2 ... in reading order, because a transaction's CurrencyId is that position.\n\nSteps:\n1. Sort transactions by CustomerId and left-join them to customers with a merge join (CustomerId = Id).\n2. Left-join the result to the rates on currency id. amount_euro = amount / rate, falling back to the original amount if the division fails. original_currency is the rate's currency code, or the numeric id as text when there's no rate.\n3. Route: no customer -> sheet 'missing-customers'; currency still numeric (not resolved) -> sheet 'missing-currency'; everything else continues.\n4. Sum amount_euro per customer (keep first/last name, currency '€'), sort by amount descending, keep the first 20.\n5. Write the top 20 to sheet 'top-20-customers' and to ${DATAOUT_DIR}/top-20-customers.html as a table with columns Customer, Amount, Currency, Full Name.\n\nAll three sheets are in ${DATAOUT_DIR}/reports.xlsx, so write them in separate phases.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n- TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n- MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n- MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n\nFlow:\n1. LOAD_CUSTOMER_DETAILS: read ${DATAIN_DIR}/customers.csv → MATCH_TRANSACTIONS_WITH_CUSTOMER:1\n2. LOAD_ONLINE_EXCHANGE_RATES1: read XML ${RATES_FILE} → FORMAT_FIELDS: map (CTL) → CONVERT_CURRENCY_TO_EURO:1\n3. LOAD_TRANSACTIONS: read ${DATAIN_DIR}/transactions.csv → SORT_TRANSACTIONS: sort by CustomerId asc → MATCH_TRANSACTIONS_WITH_CUSTOMER\n4. MATCH_TRANSACTIONS_WITH_CUSTOMER: left merge join on CustomerId = Id (CTL) → CONVERT_CURRENCY_TO_EURO\n5. CONVERT_CURRENCY_TO_EURO: left hash join on currency = id (CTL) → ROUTE_RECORDS_BY_LOGIC: route (CTL)\n - out 0 → MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n - out 1 → MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n - out 2 → SUM_TRANSACTIONS_BY_CUSTOMER: aggregate per customer_id: customer_last_name = first(customer_last_name), customer_first_name = first(customer_first_name), amount = sum(amount_euro) → SORT_BY_AMOUNT_DESCENDING: sort by amount desc → GET_TOP_20: keep the first 20 records → SIMPLE_COPY: copy to 2 outputs\n - out 0 → TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n - out 1 → TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n\nRecords:\n- LOAD_CUSTOMER_DETAILS → Customers: Id integer, LastName string, FirstName string\n- LOAD_ONLINE_EXCHANGE_RATES1 → rates: currency string, rate decimal\n- FORMAT_FIELDS: rates → rates_with_id: +id integer\n- LOAD_TRANSACTIONS → Transactions: TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: Transactions + Customers → transaction_joined: customer_id integer, customer_last_name string, customer_first_name string, transaction_id integer, amount decimal, currency integer\n- CONVERT_CURRENCY_TO_EURO: transaction_joined + rates_with_id → transaction_with_currency: +original_currency string, +original_currency_id integer, +amount_euro decimal, -amount, -currency, -rate, -id\n- SUM_TRANSACTIONS_BY_CUSTOMER: transaction_with_currency → transactions_summed: customer_id integer, customer_last_name string, customer_first_name string, amount decimal, currency string\n\nNotes:\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: a merge join needs inputs sorted on the key: input 0 by CustomerId (sorted by SORT_TRANSACTIONS on CustomerId asc); input 1 by Id (no sort upstream: assumes LOAD_CUSTOMER_DETAILS delivers it sorted).\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: left join keeps input 0 records without a match; input 1 fields are null for them.\n- CONVERT_CURRENCY_TO_EURO: hash join holds input 1 (FORMAT_FIELDS) in memory as the lookup side and streams input 0; no sorting needed.\n- CONVERT_CURRENCY_TO_EURO: left join keeps input 0 records without a match; input 1 fields are null for them.\n- SUM_TRANSACTIONS_BY_CUSTOMER: a sorted aggregate needs inputs sorted on the key: input 0 by customer_id (sorted by SORT_TRANSACTIONS on CustomerId asc, order kept downstream).\n- GET_TOP_20: SORT_BY_AMOUNT_DESCENDING sorts by amount desc, so keeping the first 20 records is a top 20.\n- SIMPLE_COPY: every record goes to both outputs.\n- TOP_20_CUSTOMERS_AS_SPREADSHEET, MISSING_CUSTOMERS, MISSING_CURRENCY all write ${DATAOUT_DIR}/reports.xlsx, so each runs in its own phase (0, 1, 2).\n\nPhases:\n- 0: all other nodes\n- 1: MISSING_CUSTOMERS\n- 2: MISSING_CURRENCY\n\nCTL: FORMAT_FIELDS.transform, MATCH_TRANSACTIONS_WITH_CUSTOMER.transform, CONVERT_CURRENCY_TO_EURO.transform, ROUTE_RECORDS_BY_LOGIC.partitionSource\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n- TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n- MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n- MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n\nFlow:\n1. LOAD_CUSTOMER_DETAILS: flat reader → MATCH_TRANSACTIONS_WITH_CUSTOMER:1\n2. LOAD_ONLINE_EXCHANGE_RATES1: read XML ${RATES_FILE} → FORMAT_FIELDS: map (CTL) → CONVERT_CURRENCY_TO_EURO:1\n3. LOAD_TRANSACTIONS: read ${DATAIN_DIR}/transactions.csv → SORT_TRANSACTIONS: sort by CustomerId asc → MATCH_TRANSACTIONS_WITH_CUSTOMER\n4. MATCH_TRANSACTIONS_WITH_CUSTOMER: left merge join on CustomerId = Id (CTL) → CONVERT_CURRENCY_TO_EURO\n5. CONVERT_CURRENCY_TO_EURO: left hash join on currency = id (CTL) → ROUTE_RECORDS_BY_LOGIC: route (CTL)\n - out 0 → MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n - out 1 → MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n - out 2 → SUM_TRANSACTIONS_BY_CUSTOMER: aggregate per customer_id: customer_last_name = first(customer_last_name), customer_first_name = first(customer_first_name), amount = sum(amount_euro) → SORT_BY_AMOUNT_DESCENDING: sort by amount desc → GET_TOP_20: keep the first 20 records → SIMPLE_COPY: copy to 2 outputs\n - out 0 → TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n - out 1 → TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n\nRecords:\n- LOAD_CUSTOMER_DETAILS → Customers: Id integer, LastName string, FirstName string\n- LOAD_ONLINE_EXCHANGE_RATES1 → rates: currency string, rate decimal\n- FORMAT_FIELDS: rates → rates_with_id: +id integer\n- LOAD_TRANSACTIONS → Transactions: TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: Transactions + Customers → transaction_joined: customer_id integer, customer_last_name string, customer_first_name string, transaction_id integer, amount decimal, currency integer\n- CONVERT_CURRENCY_TO_EURO: transaction_joined + rates_with_id → transaction_with_currency: +original_currency string, +original_currency_id integer, +amount_euro decimal, -amount, -currency, -rate, -id\n- SUM_TRANSACTIONS_BY_CUSTOMER: transaction_with_currency → transactions_summed: customer_id integer, customer_last_name string, customer_first_name string, amount decimal, currency string\n\nNotes:\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: a merge join needs inputs sorted on the key: input 0 by CustomerId (sorted by SORT_TRANSACTIONS on CustomerId asc); input 1 by Id (no sort upstream: assumes LOAD_CUSTOMER_DETAILS delivers it sorted).\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: left join keeps input 0 records without a match; input 1 fields are null for them.\n- CONVERT_CURRENCY_TO_EURO: hash join holds input 1 (FORMAT_FIELDS) in memory as the lookup side and streams input 0; no sorting needed.\n- CONVERT_CURRENCY_TO_EURO: left join keeps input 0 records without a match; input 1 fields are null for them.\n- SUM_TRANSACTIONS_BY_CUSTOMER: a sorted aggregate needs inputs sorted on the key: input 0 by customer_id (sorted by SORT_TRANSACTIONS on CustomerId asc, order kept downstream).\n- GET_TOP_20: SORT_BY_AMOUNT_DESCENDING sorts by amount desc, so keeping the first 20 records is a top 20.\n- SIMPLE_COPY: every record goes to both outputs.\n- TOP_20_CUSTOMERS_AS_SPREADSHEET, MISSING_CUSTOMERS, MISSING_CURRENCY all write ${DATAOUT_DIR}/reports.xlsx, so each runs in its own phase (0, 1, 2).\n\nPhases:\n- 0: all other nodes\n- 1: MISSING_CUSTOMERS\n- 2: MISSING_CURRENCY\n\nCTL: FORMAT_FIELDS.transform, MATCH_TRANSACTIONS_WITH_CUSTOMER.transform, CONVERT_CURRENCY_TO_EURO.transform, ROUTE_RECORDS_BY_LOGIC.partitionSource\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example1-TopCustomers__TopCustomers.grf", "group": "example1", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Build a graph that finds our top 20 spending customers.\n\nInputs:\n- customers: ${DATAIN_DIR}/customers.csv, semicolon-delimited with a header row: Id (integer), LastName, FirstName.\n- transactions: ${DATAIN_DIR}/transactions.csv, fixed-width, metadata ${META_DIR}/Transactions.fmt.\n- exchange rates: the ECB daily XML at graph parameter RATES_FILE (default https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml). The rates are the innermost Cube elements (currency, rate with 5 decimals). They have no numeric id: number them 0, 1, 2 ... in reading order, because a transaction's CurrencyId is that position.\n\nSteps:\n1. Sort transactions by CustomerId and left-join them to customers with a merge join (CustomerId = Id).\n2. Left-join the result to the rates on currency id. amount_euro = amount / rate, falling back to the original amount if the division fails. original_currency is the rate's currency code, or the numeric id as text when there's no rate.\n3. Route: no customer -> sheet 'missing-customers'; currency still numeric (not resolved) -> sheet 'missing-currency'; everything else continues.\n4. Sum amount_euro per customer (keep first/last name, currency '€'), sort by amount descending, keep the first 20.\n5. Write the top 20 to sheet 'top-20-customers' and to ${DATAOUT_DIR}/top-20-customers.html as a table with columns Customer, Amount, Currency, Full Name.\n\nAll three sheets are in ${DATAOUT_DIR}/reports.xlsx, so write them in separate phases.\n\nProject metadata files:\n- ${META_DIR}/Customer.fmt: Customer (delimited): id long, fullName string, streetAddress string, city string, postalCode string, state string, country string, email string, phone string, accountCreated date \"yyyy-MM-dd\", isActive boolean\n- ${META_DIR}/FlatFileReader_Error.fmt: FlatFileReader_Error (delimited): recordNo long, fieldNo integer, originalData string, errorMessage string, fileURL string\n- ${META_DIR}/Product.fmt: Product (delimited): productName string, productCode long, unitPrice decimal, supplierName string, profitMargin decimal\n- ${META_DIR}/Transactions.fmt: Transactions (fixed): TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer"}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n- TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n- MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n- MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n\nFlow:\n1. LOAD_CUSTOMER_DETAILS: read ${DATAIN_DIR}/customers.csv → MATCH_TRANSACTIONS_WITH_CUSTOMER:1\n2. LOAD_ONLINE_EXCHANGE_RATES1: read XML ${RATES_FILE} → FORMAT_FIELDS: map (CTL) → CONVERT_CURRENCY_TO_EURO:1\n3. LOAD_TRANSACTIONS: read ${DATAIN_DIR}/transactions.csv → SORT_TRANSACTIONS: sort by CustomerId asc → MATCH_TRANSACTIONS_WITH_CUSTOMER\n4. MATCH_TRANSACTIONS_WITH_CUSTOMER: left merge join on CustomerId = Id (CTL) → CONVERT_CURRENCY_TO_EURO\n5. CONVERT_CURRENCY_TO_EURO: left hash join on currency = id (CTL) → ROUTE_RECORDS_BY_LOGIC: route (CTL)\n - out 0 → MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n - out 1 → MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n - out 2 → SUM_TRANSACTIONS_BY_CUSTOMER: aggregate per customer_id: customer_last_name = first(customer_last_name), customer_first_name = first(customer_first_name), amount = sum(amount_euro) → SORT_BY_AMOUNT_DESCENDING: sort by amount desc → GET_TOP_20: keep the first 20 records → SIMPLE_COPY: copy to 2 outputs\n - out 0 → TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n - out 1 → TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n\nRecords:\n- LOAD_CUSTOMER_DETAILS → Customers: Id integer, LastName string, FirstName string\n- LOAD_ONLINE_EXCHANGE_RATES1 → rates: currency string, rate decimal\n- FORMAT_FIELDS: rates → rates_with_id: +id integer\n- LOAD_TRANSACTIONS → Transactions: TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: Transactions + Customers → transaction_joined: customer_id integer, customer_last_name string, customer_first_name string, transaction_id integer, amount decimal, currency integer\n- CONVERT_CURRENCY_TO_EURO: transaction_joined + rates_with_id → transaction_with_currency: +original_currency string, +original_currency_id integer, +amount_euro decimal, -amount, -currency, -rate, -id\n- SUM_TRANSACTIONS_BY_CUSTOMER: transaction_with_currency → transactions_summed: customer_id integer, customer_last_name string, customer_first_name string, amount decimal, currency string\n\nNotes:\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: a merge join needs inputs sorted on the key: input 0 by CustomerId (sorted by SORT_TRANSACTIONS on CustomerId asc); input 1 by Id (no sort upstream: assumes LOAD_CUSTOMER_DETAILS delivers it sorted).\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: left join keeps input 0 records without a match; input 1 fields are null for them.\n- CONVERT_CURRENCY_TO_EURO: hash join holds input 1 (FORMAT_FIELDS) in memory as the lookup side and streams input 0; no sorting needed.\n- CONVERT_CURRENCY_TO_EURO: left join keeps input 0 records without a match; input 1 fields are null for them.\n- SUM_TRANSACTIONS_BY_CUSTOMER: a sorted aggregate needs inputs sorted on the key: input 0 by customer_id (sorted by SORT_TRANSACTIONS on CustomerId asc, order kept downstream).\n- GET_TOP_20: SORT_BY_AMOUNT_DESCENDING sorts by amount desc, so keeping the first 20 records is a top 20.\n- SIMPLE_COPY: every record goes to both outputs.\n- TOP_20_CUSTOMERS_AS_SPREADSHEET, MISSING_CUSTOMERS, MISSING_CURRENCY all write ${DATAOUT_DIR}/reports.xlsx, so each runs in its own phase (0, 1, 2).\n\nPhases:\n- 0: all other nodes\n- 1: MISSING_CUSTOMERS\n- 2: MISSING_CURRENCY\n\nCTL: FORMAT_FIELDS.transform, MATCH_TRANSACTIONS_WITH_CUSTOMER.transform, CONVERT_CURRENCY_TO_EURO.transform, ROUTE_RECORDS_BY_LOGIC.partitionSource\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n- TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n- MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n- MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n\nFlow:\n1. LOAD_CUSTOMER_DETAILS: read ${DATAIN_DIR}/customers.csv → MATCH_TRANSACTIONS_WITH_CUSTOMER:1\n2. LOAD_ONLINE_EXCHANGE_RATES1: read XML ${RATES_FILE} → FORMAT_FIELDS: map (CTL) → CONVERT_CURRENCY_TO_EURO:1\n3. LOAD_TRANSACTIONS: read ${DATAIN_DIR}/transactions.csv → SORT_TRANSACTIONS: sort by CustomerId asc → MATCH_TRANSACTIONS_WITH_CUSTOMER\n4. MATCH_TRANSACTIONS_WITH_CUSTOMER: left merge join on CustomerId = Id (CTL) → CONVERT_CURRENCY_TO_EURO\n5. CONVERT_CURRENCY_TO_EURO: left hash join on currency = id (CTL) → ROUTE_RECORDS_BY_LOGIC: route (CTL)\n - out 0 → MISSING_CUSTOMERS: write ${DATAOUT_DIR}/reports.xlsx sheet missing-customers\n - out 1 → MISSING_CURRENCY: write ${DATAOUT_DIR}/reports.xlsx sheet missing-currency\n - out 2 → SUM_TRANSACTIONS_BY_CUSTOMER: aggregate per customer_id: customer_last_name = first(customer_last_name), customer_first_name = first(customer_first_name), amount = sum(amount_euro) → SORT_BY_AMOUNT_DESCENDING: sort by amount desc → GET_TOP_20: keep the first 20 records → SIMPLE_COPY: copy to 2 outputs\n - out 0 → TOP_20_CUSTOMERS_AS_SPREADSHEET: write ${DATAOUT_DIR}/reports.xlsx sheet top-20-customers\n - out 1 → TOP_20_CUSTOMERS_AS_HTML: write ${DATAOUT_DIR}/top-20-customers.html from a template\n\nRecords:\n- LOAD_ONLINE_EXCHANGE_RATES1 → rates: currency string, rate decimal\n- FORMAT_FIELDS: rates → rates_with_id: +id integer\n- LOAD_TRANSACTIONS → Transactions: TransactionId integer, CustomerId integer, Amount decimal, CurrencyId integer\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: Transactions + Metadata7_v2 → transaction_joined: customer_id integer, customer_last_name string, customer_first_name string, transaction_id integer, amount decimal, currency integer\n- CONVERT_CURRENCY_TO_EURO: transaction_joined + rates_with_id → transaction_with_currency: +original_currency string, +original_currency_id integer, +amount_euro decimal, -amount, -currency, -rate, -id\n- SUM_TRANSACTIONS_BY_CUSTOMER: transaction_with_currency → transactions_summed: customer_id integer, customer_last_name string, customer_first_name string, amount decimal, currency string\n\nNotes:\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: a merge join needs inputs sorted on the key: input 0 by CustomerId (sorted by SORT_TRANSACTIONS on CustomerId asc); input 1 by Id (no sort upstream: assumes LOAD_CUSTOMER_DETAILS delivers it sorted).\n- MATCH_TRANSACTIONS_WITH_CUSTOMER: left join keeps input 0 records without a match; input 1 fields are null for them.\n- CONVERT_CURRENCY_TO_EURO: hash join holds input 1 (FORMAT_FIELDS) in memory as the lookup side and streams input 0; no sorting needed.\n- CONVERT_CURRENCY_TO_EURO: left join keeps input 0 records without a match; input 1 fields are null for them.\n- SUM_TRANSACTIONS_BY_CUSTOMER: a sorted aggregate needs inputs sorted on the key: input 0 by customer_id (sorted by SORT_TRANSACTIONS on CustomerId asc, order kept downstream).\n- GET_TOP_20: SORT_BY_AMOUNT_DESCENDING sorts by amount desc, so keeping the first 20 records is a top 20.\n- SIMPLE_COPY: every record goes to both outputs.\n- TOP_20_CUSTOMERS_AS_SPREADSHEET, MISSING_CUSTOMERS, MISSING_CURRENCY all write ${DATAOUT_DIR}/reports.xlsx, so each runs in its own phase (0, 1, 2).\n\nPhases:\n- 0: all other nodes\n- 1: MISSING_CUSTOMERS\n- 2: MISSING_CURRENCY\n\nCTL: FORMAT_FIELDS.transform, MATCH_TRANSACTIONS_WITH_CUSTOMER.transform, CONVERT_CURRENCY_TO_EURO.transform, ROUTE_RECORDS_BY_LOGIC.partitionSource\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n]]>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "graph__Example1-TopCustomers__TopCustomers.grf", "group": "example1", "kind": "edge_meta_ref"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Probe ExtHashJoin with an inner join and slaveDuplicates=false. Master (k integer, m string): k = 1, 2 and m = m1, m2. Slave (k integer, s string): k = 1, 1, 3 and s = first, second, third. Generate both with DataGenerators, join on k into (k, m, s), write joined records to suite_v5/probe_kb/hj_nodup_0.txt and unmatched masters (port 1) to suite_v5/probe_kb/hj_nodup_1.txt."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- W0: write suite_v5/probe_kb/hj_nodup_0.txt\n- W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nFlow:\n1. GM: generate 2 records (CTL) → J\n2. GS: generate 3 records (CTL) → J:1\n3. J: inner hash join on k = k (CTL)\n - out 0 → W0: write suite_v5/probe_kb/hj_nodup_0.txt\n - out 1 → W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nRecords:\n- GM → Mst: k integer, m string\n- GS → Slv: k integer, s string\n- J: Mst + Slv → Out (same fields)\n\nNotes:\n- J: hash join holds input 1 (GS) in memory as the lookup side and streams input 0; no sorting needed; one lookup record per key (slaveDuplicates=false).\n\nCTL: GM.generate, GS.generate, J.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- W0: write suite_v5/probe_kb/hj_nodup_0.txt\n- W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nFlow:\n1. GM: generator (CTL) → J\n2. GS: generate 3 records (CTL) → J:1\n3. J: inner hash join on k = k (CTL)\n - out 0 → W0: write suite_v5/probe_kb/hj_nodup_0.txt\n - out 1 → W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nRecords:\n- GM → Mst: k integer, m string\n- GS → Slv: k integer, s string\n- J: Mst + Slv → Out (same fields)\n\nNotes:\n- J: hash join holds input 1 (GS) in memory as the lookup side and streams input 0; no sorting needed; one lookup record per key (slaveDuplicates=false).\n\nCTL: GM.generate, GS.generate, J.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "suite_v5__probe_kb__hj_nodup.grf", "group": "probe_kb", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Probe ExtHashJoin with an inner join and slaveDuplicates=false. Master (k integer, m string): k = 1, 2 and m = m1, m2. Slave (k integer, s string): k = 1, 1, 3 and s = first, second, third. Generate both with DataGenerators, join on k into (k, m, s), write joined records to suite_v5/probe_kb/hj_nodup_0.txt and unmatched masters (port 1) to suite_v5/probe_kb/hj_nodup_1.txt."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- W0: write suite_v5/probe_kb/hj_nodup_0.txt\n- W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nFlow:\n1. GM: generate 2 records (CTL) → J\n2. GS: generate 3 records (CTL) → J:1\n3. J: inner hash join on k = k (CTL)\n - out 0 → W0: write suite_v5/probe_kb/hj_nodup_0.txt\n - out 1 → W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nRecords:\n- GM → Mst: k integer, m string\n- GS → Slv: k integer, s string\n- J: Mst + Slv → Out (same fields)\n\nNotes:\n- J: hash join holds input 1 (GS) in memory as the lookup side and streams input 0; no sorting needed; one lookup record per key (slaveDuplicates=false).\n\nCTL: GM.generate, GS.generate, J.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- W0: write suite_v5/probe_kb/hj_nodup_0.txt\n- W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nFlow:\n1. GM: generate 2 records (CTL) → J\n2. GS: generate 3 records (CTL) → J:1\n3. J: inner hash join on k = k (CTL)\n - out 0 → W0: write suite_v5/probe_kb/hj_nodup_0.txt\n - out 1 → W1: write suite_v5/probe_kb/hj_nodup_1.txt\n\nRecords:\n- GS → Slv: k integer, s string\n- J: Mst_v2 + Slv → Out: +m string\n- J: Mst_v2 + Slv → Mst: +m string, -s\n\nNotes:\n- J: hash join holds input 1 (GS) in memory as the lookup side and streams input 0; no sorting needed; one lookup record per key (slaveDuplicates=false).\n\nCTL: GM.generate, GS.generate, J.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "suite_v5__probe_kb__hj_nodup.grf", "group": "probe_kb", "kind": "edge_meta_ref"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Probe ExtMergeJoin with a left outer join. Master (k integer, m string): k = 1, 2 and m = m1, m2. Slave (k integer, s string): k = 1, 1, 3 and s = first, second, third. Generate both with DataGenerators (already sorted by k), join on k into (k, m, s), write joined records to suite_v5/probe_kb/mj_left_0.txt and port 1 (master record format) to suite_v5/probe_kb/mj_left_1.txt."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- W0: write suite_v5/probe_kb/mj_left_0.txt\n- W1: write suite_v5/probe_kb/mj_left_1.txt\n\nFlow:\n1. GM: generate 2 records (CTL) → J\n2. GS: generate 3 records (CTL) → J:1\n3. J: left merge join on k = k (CTL)\n - out 0 → W0: write suite_v5/probe_kb/mj_left_0.txt\n - out 1 → W1: write suite_v5/probe_kb/mj_left_1.txt\n\nRecords:\n- GM → Mst: k integer, m string\n- GS → Slv: k integer, s string\n- J: Mst + Slv → Out (same fields)\n\nNotes:\n- J: a merge join needs inputs sorted on the key: input 0 by k (no sort upstream: assumes GM delivers it sorted); input 1 by k (no sort upstream: assumes GS delivers it sorted).\n- J: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: GM.generate, GS.generate, J.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- W0: write suite_v5/probe_kb/mj_left_0.txt\n- W1: write suite_v5/probe_kb/mj_left_1.txt\n\nFlow:\n1. GM: generate 2 records (CTL) → J\n2. GS: generate 3 records (CTL) → J:1\n3. J: left merge join on k = k (CTL)\n - out 0 → W0: write suite_v5/probe_kb/mj_left_0.txt\n - out 1 → W1: write suite_v5/probe_kb/mj_left_1.txt\n\nRecords:\n- GM → Mst: k integer, m string\n- GS → Slv: k integer, s string\n- J: Mst + Slv → Out (same fields)\n\nNotes:\n- J: a merge join needs inputs sorted on the key: input 0 by k (no sort upstream: assumes GM delivers it sorted); input 1 by k (no sort upstream: assumes GS delivers it sorted).\n- J: left join keeps input 0 records without a match; input 1 fields are null for them.\n\nCTL: GM.generate, GS.generate, J.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "suite_v5__probe_kb__mj_left.grf", "group": "probe_kb", "kind": "ctl_field"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Haze canister bookings for a theatre.\n\nInput opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv: pipe-delimited, quoted strings, null written as __NULL__, locale en.US, strict data policy. All fields are text: cue_ticket, fluid_ml, courtesy, rehearsal_room, cue_time, replacement_cost, canister_serial, programme_note (cue_ticket, cue_time and canister_serial are required).\n\nDecode to types: courtesy boolean, cue_time date 'yyyy-MM-dd HH:mm:ss.SSS' (UTC, strict), replacement_cost decimal(16,2), canister_serial long.\n\nRules, applied in input order, with state in dictionary entries reservation_live (boolean, starts true), bookings_used (long, 0) and litres_drawn (decimal, 0.00):\n- reservation not live -> SUSPENDED\n- not courtesy and fluid_ml isn't a number with up to 3 integer and 2 decimal digits -> BAD_ORDER\n- value = 0 for courtesy, otherwise fluid_ml; if litres_drawn + value > 6.00 or bookings_used >= 4 -> OVERDRAWN\n- otherwise BOOKED: add value and one booking; close the reservation once exactly 6.00 litres or 4 bookings are reached.\n\nOutput every input field plus litres_booked (running litres formatted '0.00'), bookings_used and booking_result. BOOKED goes to port 0, everything else to port 1. Encode back to text and write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv and _out_1.csv in the input's format (overwrite, create dirs, create empty files)."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n- Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nFlow:\n1. Reader0: read opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv → Decode0: map (CTL) → Test: map (CTL)\n - out 0 → Encode0: map (CTL) → Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n - out 1 → Encode1: map (CTL) → Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nRecords:\n- Reader0 → RawInput0: cue_ticket string, fluid_ml string, courtesy string, rehearsal_room string, cue_time string, replacement_cost string, canister_serial string, programme_note string\n- Decode0: RawInput0 → G1In01: ~courtesy string→boolean, ~cue_time string→date, ~replacement_cost string→decimal, ~canister_serial string→long\n- Test: G1In01 → G1Out01P0, G1Out01P1: +litres_booked string, +bookings_used long, +booking_result string\n- Encode0: G1Out01P0 → RawOutput0: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n- Encode1: G1Out01P1 → RawOutput1: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n\nCTL: Decode0.transform, Test.transform, Encode0.transform, Encode1.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n- Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nFlow:\n1. Reader0: flat reader → Decode0: map (CTL) → Test: map (CTL)\n - out 0 → Encode0: map (CTL) → Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n - out 1 → Encode1: map (CTL) → Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nRecords:\n- Reader0 → RawInput0: cue_ticket string, fluid_ml string, courtesy string, rehearsal_room string, cue_time string, replacement_cost string, canister_serial string, programme_note string\n- Decode0: RawInput0 → G1In01: ~courtesy string→boolean, ~cue_time string→date, ~replacement_cost string→decimal, ~canister_serial string→long\n- Test: G1In01 → G1Out01P0, G1Out01P1: +litres_booked string, +bookings_used long, +booking_result string\n- Encode0: G1Out01P0 → RawOutput0: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n- Encode1: G1Out01P1 → RawOutput1: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n\nCTL: Decode0.transform, Test.transform, Encode0.transform, Encode1.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "opcd_gaps__graph__opcd_gen_G1_01.grf", "group": "opcd", "kind": "component_type"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Haze canister bookings for a theatre.\n\nInput opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv: pipe-delimited, quoted strings, null written as __NULL__, locale en.US, strict data policy. All fields are text: cue_ticket, fluid_ml, courtesy, rehearsal_room, cue_time, replacement_cost, canister_serial, programme_note (cue_ticket, cue_time and canister_serial are required).\n\nDecode to types: courtesy boolean, cue_time date 'yyyy-MM-dd HH:mm:ss.SSS' (UTC, strict), replacement_cost decimal(16,2), canister_serial long.\n\nRules, applied in input order, with state in dictionary entries reservation_live (boolean, starts true), bookings_used (long, 0) and litres_drawn (decimal, 0.00):\n- reservation not live -> SUSPENDED\n- not courtesy and fluid_ml isn't a number with up to 3 integer and 2 decimal digits -> BAD_ORDER\n- value = 0 for courtesy, otherwise fluid_ml; if litres_drawn + value > 6.00 or bookings_used >= 4 -> OVERDRAWN\n- otherwise BOOKED: add value and one booking; close the reservation once exactly 6.00 litres or 4 bookings are reached.\n\nOutput every input field plus litres_booked (running litres formatted '0.00'), bookings_used and booking_result. BOOKED goes to port 0, everything else to port 1. Encode back to text and write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv and _out_1.csv in the input's format (overwrite, create dirs, create empty files)."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n- Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nFlow:\n1. Reader0: read opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv → Decode0: map (CTL) → Test: map (CTL)\n - out 0 → Encode0: map (CTL) → Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n - out 1 → Encode1: map (CTL) → Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nRecords:\n- Reader0 → RawInput0: cue_ticket string, fluid_ml string, courtesy string, rehearsal_room string, cue_time string, replacement_cost string, canister_serial string, programme_note string\n- Decode0: RawInput0 → G1In01: ~courtesy string→boolean, ~cue_time string→date, ~replacement_cost string→decimal, ~canister_serial string→long\n- Test: G1In01 → G1Out01P0, G1Out01P1: +litres_booked string, +bookings_used long, +booking_result string\n- Encode0: G1Out01P0 → RawOutput0: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n- Encode1: G1Out01P1 → RawOutput1: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n\nCTL: Decode0.transform, Test.transform, Encode0.transform, Encode1.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n- Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nFlow:\n1. Reader0: read opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv → Decode0: map (CTL) → Test: map (CTL)\n - out 0 → Encode0: map (CTL) → Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n - out 1 → Encode1: map (CTL) → Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nRecords:\n- Decode0: RawIn0_v2 → G1In01: +cue_ticket string, +fluid_ml string, +courtesy boolean, +rehearsal_room string, +cue_time date, +replacement_cost decimal, +canister_serial long, +programme_note string\n- Test: G1In01 → G1Out01P0, G1Out01P1: +litres_booked string, +bookings_used long, +booking_result string\n- Encode0: G1Out01P0 → RawOutput0: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n- Encode1: G1Out01P1 → RawOutput1: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n\nCTL: Decode0.transform, Test.transform, Encode0.transform, Encode1.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "opcd_gaps__graph__opcd_gen_G1_01.grf", "group": "opcd", "kind": "edge_meta_ref"} {"prompt": [{"role": "system", "content": "You build CloverDX ETL graphs. Answer with a graph in the compact IR form:\n- with (Metadata, GraphParameters, Dictionary) and sections.\n- In each phase, every is followed by its outgoing .\n- Component properties are attributes; multi-line values (CTL2 code starting with //#CTL2, mappings) are CDATA children.\n- No GUI layout, edge ids or default values. Edges may omit metadata when it propagates from the input.\n- Project parameters from workspace.prm: ${DATAIN_DIR}, ${DATAOUT_DIR}, ${META_DIR}, ${LOOKUP_DIR}, ${ERROR_DIR}, ${PROJECT}.\n- When building a graph, first write ## Plan: Outputs; Flow (numbered chains `ID: what → ID: what`, a node with\n several outputs lists them as `- out N → ...` lines, `→ ID:1` feeds input port 1 of a node that has its own line);\n Records (how each node changes the record); Notes (sort requirements, lookup sides, phases); Phases; CTL.\n Then ## Graph, which must follow the plan exactly."}, {"role": "user", "content": "Haze canister bookings for a theatre.\n\nInput opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv: pipe-delimited, quoted strings, null written as __NULL__, locale en.US, strict data policy. All fields are text: cue_ticket, fluid_ml, courtesy, rehearsal_room, cue_time, replacement_cost, canister_serial, programme_note (cue_ticket, cue_time and canister_serial are required).\n\nDecode to types: courtesy boolean, cue_time date 'yyyy-MM-dd HH:mm:ss.SSS' (UTC, strict), replacement_cost decimal(16,2), canister_serial long.\n\nRules, applied in input order, with state in dictionary entries reservation_live (boolean, starts true), bookings_used (long, 0) and litres_drawn (decimal, 0.00):\n- reservation not live -> SUSPENDED\n- not courtesy and fluid_ml isn't a number with up to 3 integer and 2 decimal digits -> BAD_ORDER\n- value = 0 for courtesy, otherwise fluid_ml; if litres_drawn + value > 6.00 or bookings_used >= 4 -> OVERDRAWN\n- otherwise BOOKED: add value and one booking; close the reservation once exactly 6.00 litres or 4 bookings are reached.\n\nOutput every input field plus litres_booked (running litres formatted '0.00'), bookings_used and booking_result. BOOKED goes to port 0, everything else to port 1. Encode back to text and write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv and _out_1.csv in the input's format (overwrite, create dirs, create empty files)."}], "chosen": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n- Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nFlow:\n1. Reader0: read opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv → Decode0: map (CTL) → Test: map (CTL)\n - out 0 → Encode0: map (CTL) → Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n - out 1 → Encode1: map (CTL) → Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nRecords:\n- Reader0 → RawInput0: cue_ticket string, fluid_ml string, courtesy string, rehearsal_room string, cue_time string, replacement_cost string, canister_serial string, programme_note string\n- Decode0: RawInput0 → G1In01: ~courtesy string→boolean, ~cue_time string→date, ~replacement_cost string→decimal, ~canister_serial string→long\n- Test: G1In01 → G1Out01P0, G1Out01P1: +litres_booked string, +bookings_used long, +booking_result string\n- Encode0: G1Out01P0 → RawOutput0: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n- Encode1: G1Out01P1 → RawOutput1: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n\nCTL: Decode0.transform, Test.transform, Encode0.transform, Encode1.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "rejected": [{"role": "assistant", "content": "## Plan\nOutputs:\n- Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n- Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nFlow:\n1. Reader0: read opcd_gaps/data-in/opcd_gen_G1_01_input_0.csv → Decode0: map (CTL) → Test: map (CTL)\n - out 0 → Encode0: map (CTL) → Writer0: write opcd_gaps/data-out/opcd_gen_G1_01_out_0.csv\n - out 1 → Encode1: map (CTL) → Writer1: write opcd_gaps/data-out/opcd_gen_G1_01_out_1.csv\n\nRecords:\n- Decode0 → G1In01: cue_ticket string, fluid_ml string, courtesy boolean, rehearsal_room string, cue_time date, replacement_cost decimal, canister_serial long, programme_note string\n- Test: G1In01 → G1Out01P0, G1Out01P1: +litres_booked string, +bookings_used long, +booking_result string\n- Encode0: G1Out01P0 → RawOutput0: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n- Encode1: G1Out01P1 → RawOutput1: ~courtesy boolean→string, ~cue_time date→string, ~replacement_cost decimal→string, ~canister_serial long→string, ~bookings_used long→string\n\nCTL: Decode0.transform, Test.transform, Encode0.transform, Encode1.transform\n\n## Graph\n```xml\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n```"}], "type": "syntax", "graph": "opcd_gaps__graph__opcd_gen_G1_01.grf", "group": "opcd", "kind": "edge_meta_missing"}