Eval Eval

yaml
type: "io.kestra.plugin.scripts.groovy.Eval"

Execute a groovy script.

Examples

yaml
id: "eval"
type: "io.kestra.plugin.scripts.groovy.Eval"
outputs:
  - out
  - map
script: |
  import io.kestra.core.models.executions.metrics.Counter
  
  logger.info('executionId: {}', runContext.render('{{ execution.id }}'))
  runContext.metric(Counter.of('total', 666, 'name', 'bla'))
  
  map = Map.of('test', 'here')
  File tempFile = runContext.tempFile().toFile()
  var output = new FileOutputStream(tempFile)
  output.write('555\n666\n'.getBytes())
  
  out = runContext.putTempFile(tempFile)

Properties

outputs

  • Type: array
  • SubType: string
  • Dynamic:
  • Required:

A List of outputs variables that will be usable in outputs.

script

  • Type: string
  • Dynamic: ✔️
  • Required:

A full script

Outputs

outputs

  • Type: object

The captured outputs as declared on task property.

result

  • Type: object

The resulting object

Mostly the last return of eval (if the language allow it)