OpenFn / core

The central job processing module used in OpenFn v1.

Home Page:https://www.openfn.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider allowing state, configuration and final state options to be declared in the expression

stuartc opened this issue · comments

Instead of having a growing list of configuration keys, or writing the state to disk before; consider those directives existing in the expression itself (being either added automatically by the server or directly by the user).

const state = getState(...)
const configuration = getConfiguration(...)

This would allow other things like multiple credentials for more complex jobs...

const myCert = OpenFn.getCredential('myCert')
...

And last but not least, unpacking finalState from core.

OpenFn.writeState(state)

The OpenFn provided functions would need to be bound to the job on the server in order to authenticate and tie back any data to the specific invocation etc.


This pattern is only achievable once we are able to write more than just callExpressions on the root - same as #21