Skip to content

No way to add temp:variable during Runner.runAsync #260

@wbyoung

Description

@wbyoung

Is your feature request related to a problem? Please describe.

There's no way to inject a temporary variable into the session state at the start of an invocation. The temp: prefixed variables are filtered out.

The workarounds I've thought through (like leveraging plugins) seem over the top.

Describe the solution you'd like

Add a way for the caller access the invocation context or the session during/after the call to Runner.runAsync.

For instance:

runner.runAsync({
  // existing params
  beforeRunCallback: ({ invocationContext }) => {
    invocationContext.session.state.set('temp:var', 'value')
  },
})

Describe alternatives you've considered

This is roughly how plugins work, but plugins don't have a way to access the local scope in which runner.runAsync was called (unless a new runner is created which doesn't seem to be recommended for long running processes like API servers).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestneeds review[Status] The PR/issue is awaiting review from the maintainer
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions