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
| Input | Type | Required | Description |
|---|---|---|---|
organizationId | int | Yes | Target organization |
fileUrl | string? | No | URL to download the import file from |
fileType | FileType? | No | File format (auto-detected from URL if omitted). Required when using stream |
stream | Stream? | No | Raw file stream for direct input |
postalCodes | List<PostalCodeExportDto>? | No | Inline postal code data (converted to JSON internally) |
matchByFields | string[]? | No | Fields 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
| Output | Type | Description |
|---|---|---|
result.success | bool | true if no errors occurred |
result.added | int | Number of new postal codes created |
result.updated | int | Number of existing postal codes updated |
result.errors | List<string> | List of error messages (empty on success) |
result.totalProcessed | int | Total records processed (added + updated) |
result.hasErrors | bool | true 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.