Loading

How to get worker id in CloudHub

Udgivelsesdato: Jul 17, 2025
Opgave

GOAL

To get the worker id from a CloudHub worker when using Cloudhub Fabric
Trin
Access to the worker ID can be achieved by accessing the following property: 
${worker.id}
This can be logged out and returns a value such as: "0", "1", "2", etc. 

A simple example can be seen below: 
<flow name="worker-id-exampleFlow1">
    <poll doc:name="Poll">
        <set-payload value="#[]" doc:name="Set Payload"/>
    </poll>
    <vm:outbound-endpoint exchange-pattern="one-way" path="queue" doc:name="VM"/>
</flow>
<flow name="worker-id-exampleFlow2">
    <vm:inbound-endpoint exchange-pattern="one-way" path="queue" doc:name="VM"/>
    <logger message="#[${worker.id}]" level="INFO" doc:name="Logger"/>
</flow>
This will print the following in the logs, showing the worker number: 
10:49:52.976     02/27/2018     Worker-1     [worker-id-example].worker-id-exampleFlow.stage1.02     INFO
1

Additional information about the worker running the server can be collected from using server, in a MEL expression which provides server.host and server.ip values which can be useful for identification purposes. 

For a full list of CloudHub Properties, see: Cloudhub Reserved Properties.
Vidensartikelnummer

001114505

 
Indlæser
Salesforce Help | Article