Five9 Worker

Type: Five9 Worker

A Five9 worker will route a conversation to a live agent in Five9.

Note: Five9 workers cannot be interacted with directly by users - they must be transferred from a flow worker first.

Creating a Five9 worker through cli

Save this json to a file and create a worker using the cli command sb-cli worker create file.json. Note to replace the values for CampaignName, TenantName and Url with your own.

{
  "Organization": "my-organization",
  "Config": {},
  "Data": {
    "CampaignName": "CAMPAIGN-NAME", // Required
    "TenantName": "TENANTS-NAME", // Required
    "Url": "https://app-scl.five9.com:443", // Required
    "MessageOverrides": { // optional - the default config is outlined below
      "Transferring": "Transferring you to an agent.", // optional
      "TransferFailure": "We are having difficulty connecting to an agent.", // optional
      "AgentJoined": "**{{agentName}}** has joined the chat.", // optional. {{agentName}} will be replaced with the agent's name.
      "Terminated": "Conversation has been resolved, disconnecting from live chat.", // optional
      "GenericError": "Something has gone wrong with your livechat conversation." // optional
    }
  },
  "Description": "A worker for Five9",
  "Name": "fiveNineLiveChatWorker",
  "Type": "five9-worker"
}

Sending User data to Five9

There are 2 context variables that can be set in order to make data available to Five9:

five9Contact

This will populate the contact information for the user. It is an object with the variables defined in the docs here: Five9 Documentation

five9Attributes

This will populate the attributes for the user. This is where custom data can be sent to five9, e.g.:

{
  "PolicyNumber": 1234567, // Any attributes can be set here.
  "PolicyYear": 2009
}

Other context variables

five9TransferError

If transferring to a Five9 agent fails, the worker sets five9TransferError in context to true i.e. in msg.payload.context.five9TransferError.

{
  "five9TransferError": true,
}

In successful transfers, this key will not be set in context i.e. it will be undefined.

five9TerminationEvent

When live chat is ended, the worker sets five9TerminationEvent in context i.e. in msg.payload.context.five9TerminationEvent:

{
  "terminatedBy": "AGENT", // Who terminated the live chat. Can be AGENT or CUSTOMER.
  "from": "USER", // Event origin. Note: This should not be used to determine who terminated the chat. Use terminatedBy instead.
  "eventSerialNumber": 6, // The Five9 event serial number.
  "correlationId": "abcd-1234-wxyz-7890",
  "externalId": "1234-5678-9012-3456",
  "timestamp": "2023-10-24T11:45:21.818Z",
  "displayName": "Smith", // Agent display name
  "userId": 1234567, // Agent ID
}