Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Accessing triggering event within resulted workflow execution #973

Closed
dragoslav opened this issue May 18, 2017 · 0 comments
Closed

Accessing triggering event within resulted workflow execution #973

dragoslav opened this issue May 18, 2017 · 0 comments
Milestone

Comments

@dragoslav
Copy link
Contributor

Serialized event (JSON + Base64) should be available as an environment variable.
Example:

name: event
kind: workflow
breed:
  reference: event
schedule:
  event:
    tags:
    - run:event
environment_variables:
  VAMP_WORKFLOW_DATA: ${data} # using custom env to get the event (data)
  VAMP_WORKFLOW_EXECUTION_PERIOD: '0'
  VAMP_WORKFLOW_EXECUTION_TIMEOUT: '5'
name: event
kind: breed
deployable:
  type: application/javascript
  definition: |-
    let vamp = require('vamp-node-client');
    let data = '';
    let api = new vamp.Api();

    if (process.env.VAMP_WORKFLOW_DATA) {
      let event = Buffer.from(process.env.VAMP_WORKFLOW_DATA, 'base64').toString('utf8');
      data = event ? JSON.parse(event).tags : data;
    }
    api.event(['event:response'], data);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants