Eval Eval

type: "io.kestra.plugin.scripts.jython.Eval"

Execute a jython script.

# Examples

id: "eval"
type: "io.kestra.plugin.scripts.jython.Eval"
outputs:
  - out
  - map
script: |
  from io.kestra.core.models.executions.metrics import Counter
  import tempfile
  from java.io import File
  
  logger.info('executionId: {}', runContext.render('{{ execution.id }}'))
  runContext.metric(Counter.of('total', 666, 'name', 'bla'))
  
  map = {'test': 'here'}
  tempFile = tempfile.NamedTemporaryFile()
  tempFile.write('555\n666\n')
  
  out = runContext.putTempFile(File(tempFile.name))

# 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: ====

The resulting object

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