Inline Task
The Inline task (INLINE) executes lightweight scripting logic inside the Conductor server JVM and immediately returns a result that can be wired into downstream tasks.
The Inline task is best for small, deterministic logic like simple validation or calculation. For heavy, custom logic, it is best to use a Worker task (SIMPLE) instead.
Task parameters
Use these parameters inside inputParameters in the Inline task configuration.
| Parameter | Type | Description | Required / Optional |
|---|---|---|---|
| evaluatorType | String | The type of evaluator used. Supported types: graaljs (recommended), javascript, value-param. |
Required. |
| expression | String | The expression to be evaluated by the evaluator. The expression must return a value. The graaljs evaluator uses GraalVM JavaScript and supports modern ECMAScript. The javascript evaluator is a legacy option. The value-param evaluator returns a parameter value directly. |
Required. |
| inputParameters | Map[String, Any] | Any other input parameters for the Inline task. You can include any other input values required for evaluation here, which can be referenced in expression as $.value. |
Optional. |
Variable access inside expressions
Every key you add to inputParameters, other than expression and evaluatorType, is automatically available inside your JavaScript as a property of the $ object.
For example, given:
"inputParameters": {
"expression": "...",
"evaluatorType": "graaljs",
"value1": "${workflow.input.x}",
"value2": 42
}
You can read $.value1 and $.value2 inside the expression. This is why custom keys appear at the same indentation level as expression and evaluatorType. They are input variables, not configuration keys.
If your Inline expression references a workflow secret (such as ${workflow.secrets.<secret-name>}), the resolved value is masked in the task output. For details on masking behavior, see Masking Parameters.
Console logging
The GraalJS evaluator does not expose a built-in console object, but Orkes Conductor provides a console bridge that makes console.log, console.info, and console.error available inside Inline task scripts.
The console bridge accepts a single string argument. To include variable values, use string concatenation.
// Correct
console.log('Discount value: ' + $.discount);
// Incorrect - will fail
console.log('Discount value:', $.discount);
The output appears in the task's execution logs.
Note
As of v5.4.0, the console.* log destination is configurable. By default, logs appear in the task's execution logs in the UI, but can be redirected to server logs or discarded entirely. Contact the Orkes team to change this for your cluster.
JSON configuration
Here is the task configuration for an Inline task.
{
"name": "inline",
"taskReferenceName": "inline_ref",
"type": "INLINE",
"inputParameters": {
"evaluatorType": "graaljs",
"expression": "(function(){ return $.input1 + $.input2; })()",
"input1": 1,
"input2": 2
}
}
Output
The Inline task will return the following parameters.
| Name | Type | Description |
|---|---|---|
| result | Map | Contains the output returned by the evaluator based on the expression. |
Examples
Here are some examples for using the Inline task.
Simple example
{
"name": "INLINE_TASK",
"taskReferenceName": "inline_test",
"type": "INLINE",
"inputParameters": {
"inlineValue": "${workflow.input.inlineValue}",
"evaluatorType": "graaljs",
"expression": "function scriptFun(){if ($.inlineValue == 1){ return {testvalue: true} } else { return
{testvalue: false} }} scriptFun();"
}
}
The Inline task output can then be referenced in downstream tasks using the expression
"${inline_test.output.result.testvalue}".
Formatting data
In this example, the Inline task is used to ensure that downstream tasks only receive weather data in Celcius.
{
"name": "INLINE_TASK",
"taskReferenceName": "inline_test",
"type": "INLINE",
"inputParameters": {
"scale": "${workflow.input.tempScale}",
"temperature": "${workflow.input.temperature}",
"evaluatorType": "graaljs",
"expression": "function SIvaluesOnly(){if ($.scale === "F"){ centigrade = ($.temperature -32)*5/9; return {temperature: centigrade} } else { return
{temperature: $.temperature} }} SIvaluesOnly();"
}
}
Using console logging
In this example, the Inline task validates a discount percentage and uses console.log to write the input and the result to the task logs.
{
"name": "validate_discount",
"taskReferenceName": "validate_discount_ref",
"type": "INLINE",
"inputParameters": {
"evaluatorType": "graaljs",
"expression": "(function () { console.log('Validating discount: ' + $.discount); var isValid = $.discount >= 0 && $.discount <= 100; console.log('Result: ' + isValid); return isValid; })();",
"discount": "${workflow.input.discount}"
}
}
If the workflow input is {"discount": 15}, the task output is result: true, and the Logs tab of the task shows two entries: [Log] "Validating discount: 15" and [Log] "Result: true".