Skip to main content

PostalCode Workflow Tasks

PostalCodes/Import@1

Imports postal codes from a file URL, stream, or inline data. Supports CSV, JSON, and Excel formats. Matches existing records by configurable fields and creates or updates accordingly.

Inputs

InputTypeRequiredDescription
organizationIdintYesTarget organization
fileUrlstring?NoURL to download the import file from
fileTypeFileType?NoFile format (auto-detected from URL if omitted). Required when using stream
streamStream?NoRaw file stream for direct input
postalCodesList<PostalCodeExportDto>?NoInline postal code data (converted to JSON internally)
matchByFieldsstring[]?NoFields to match existing records by (for upsert logic)
Input Priority

Exactly one of stream, fileUrl, or postalCodes must be provided. Priority: stream > fileUrl > postalCodes.

Outputs

OutputTypeDescription
result.successbooltrue if no errors occurred
result.addedintNumber of new postal codes created
result.updatedintNumber of existing postal codes updated
result.errorsList<string>List of error messages (empty on success)
result.totalProcessedintTotal records processed (added + updated)
result.hasErrorsbooltrue if any errors occurred

Example

- task: "PostalCodes/Import@1"
name: ImportUSPostalCodes
inputs:
organizationId: "{{ int inputs.organizationId }}"
fileUrl: "{{ inputs.fileUrl }}"
matchByFields:
- code
- countryCode
outputs:
- name: importResult
mapping: "result?"

Error Handling

The task catches exceptions internally and returns them in the result.errors array rather than throwing. Check result.success or result.hasErrors to determine outcome.