Klevr Product Documentation logo

Outbound SFTP Binary Stage

The Outbound SFTP Binary stage allows binary messages, such as PDFs and images, to be exported to an external SFTP destination.

Stage Overview

The Outbound SFTP Binary stage allows binary formatted messages (e.g. PDFs, images, etc.) to be exported from the Integration Hub service to an external, SFTP-based destination.

For sending text-based messages to an external, SFTP-based destination, see the Outbound SFTP stage.

Stage Definition File Location

All Outbound SFTP Binary stages are defined by creating an appropriately formatted JSON definition file in the following location:

interfaces
{businessUnitCode}
{domainCode}
{integrationName}
out
sftp-binary
{STAGE_NAME}.json

Stage JSON Definition File Format

The JSON definition file for an Outbound SFTP Binary stage is as follows:

{
  "name": "stage-name",
  "displayName": "Brief Stage Title",
  "description": "Brief description of the stage.",
  "enabled": "$env:STATUS_<INTEGRATION_NAME>",
  "source": "source-event",
  "concurrency": 10,
  "enableVnet": false,
  "sftpDetails": {
    // See Outbound SFTP stage
  },
  "actionRetryPolicy": {
    "type": "fixed",
    "interval": "PT5S",
    "count": 90,
    "minimumInterval": "PT5S",
    "maximumInterval": "PT1H"
  },
  "emitEvent": "previous-stage-name-1",
  "emitError": false,
  "emitErrorTerminateSuccess": false,
  "leaseLockName": "lock-name"
}
PropertyDescription
nameThe name of the stage.
displayNameOptional (but highly recommended). A short (3 or 4 word) "display name" for the stage, used as a "title" of the stage in the Integration Hub Portal service's self-documentation capability.
descriptionOptional (but highly recommended). A brief (10 to 15 word) description of the stage, used as a brief description of the stage's purpose in the Integration Hub Portal service's self-documentation capability. For a more detailed explanation (when needed), use the stage markdown feature.
enabledOptional boolean flag (true or false). Default is true.

Generally set via a DevOps variable. Controls if the stage is deployed enabled or not.
sourceThe source event that the stage subscribes to. See Pub/Sub Model.

Alternatively, sources may be supplied, and an array of one or more source events can be subscribed to.
concurrencyOptional number of concurrent runs permitted for the stage. Default is 10.
enableVnetOptional. Boolean flag to indicate if the SFTP connection should use VNet integration to ensure the use of a fixed IP address or not. Default value is false.

VNet integration is only supported when deploying using Standard Logic Apps.
sftpDetailsDetails of the SFTP service to send the binary payload to. The options are the same as the Outbound SFTP stage.
actionRetryPolicyOptional details of a retry policy to be applied to the relevant SFTP actions of the stage, to allow the default retry policy when performing SFTP actions to be overridden when needed.
emitEventWhen the upload to the remote SFTP service is successful, the stage will normally terminate. However, under certain circumstances, it may be desirable to continue workflow processing.

The optional emitEvent flag allows the payload of a previously run stage to be output as a message from this stage. The stage must have previously been executed in the run history of the overall Integration Hub integration, with the stage's exported payload details being present in the Cloud Event Attributes section.
emitErrorOptional boolean flag (true or false). Default is false. When true, the stage will capture and emit a payload if a non-retryable error is detected, or if a retryable error is detected on the final retry attempt. See the Emit Error Payload section below for more details.
emitErrorTerminateSuccessOptional boolean flag (true or false). Default is false. When true, and when emitError is also true, the stage will terminate with a Successful state, rather than a Failed state, in the event of an error being detected and emitted.

When the stage is configured to operate in this way, the integration should be defined so that a subsequent stage, or series of stages, will be triggered by the emitted error payload to "handle" the error condition in such a way that reporting and alerting on the error (as would happen if the stage terminated with a Failed state) is unnecessary.
leaseLockNameOptional. See Lease Locking.

Required Payload Format

This stage must be triggered with a payload in the following format:

{
  "filename": "filename.pdf",
  "base64": "base64pfd"
}
PropertyDescription
filenameThe full name of the file that will be created on the remote SFTP service.
base64A Base64 encoded string of the file's contents. This string will be decoded into binary during creation of the remote file on the SFTP server.

Emit Error Payload

In the event that the emitError option has been set to true and:

  • a non-retryable error is detected when calling the external SFTP service; or
  • a retryable error is detected on the final retry attempt

then the stage will emit an error payload.

There is no defined format for the error payload that is emitted, as it depends on the Azure SFTP action.

The event used to emit the payload will be the full stage name with -error appended, e.g. out-sftp-binary-stage-name-error.

Last updated on