Write the final value that the platform consumes after the script finishes.
Use output commands when a task must return a host key, discovery record, or other response payload. These commands are typically the last step in a Do block, after variables and expressions have already shaped the data you want to return.
Use WriteResponseObject to emit a final response value or object.
{
"WriteResponseObject": {
"Value": "%HostKey::$%"
}
}| Name | Type | Required? | Description |
|---|---|---|---|
Value |
Value or expression | No | Object, string, or other value to write to the final response payload. |
From samples/ssh/generic-linux-with-discovery/GenericLinuxWithDiscovery.json:
{ "WriteResponseObject": { "Value": "%HostKey::$%" } }Current scripts and current engine source do not expose a separate WriteResponseProperty command. When you need named properties in the response, build the object first and then emit it with WriteResponseObject.
{
"SetItem": {
"Name": "ResponseData",
"Value": {
"HostKey": "%HostKey::$%"
}
}
}
{
"WriteResponseObject": {
"Value": "%ResponseData%"
}
}| Name | Type | Required? | Description |
|---|---|---|---|
SetItem.Name |
String | Yes | Variable that will hold the response object you are assembling. |
SetItem.Value |
Object, value, or expression | Yes | Object containing the named properties you want to return. |
WriteResponseObject.Value |
Value or expression | Yes | Variable or expression that resolves to the completed response object. |
Sample scripts typically return the completed value directly rather than writing individual properties. For example, samples/ssh/generic-linux-with-discovery/GenericLinuxWithDiscovery.json returns the discovered host key in one step:
{ "WriteResponseObject": { "Value": "%HostKey::$%" } }Multiple output-oriented commands can be used in a discovery task. For example, discovery functions may emit many
WriteDiscoveredAccountrecords, while a host-key retrieval operation usually emits a singleWriteResponseObjectvalue.
There is no separate
WriteResponsePropertykeyword in current scripts; compose an object first, then return it withWriteResponseObject.