fission / fission-workflows

Workflows for Fission: Fast, reliable and lightweight function composition for serverless functions
Apache License 2.0
371 stars 42 forks source link

Compose sub behaviours #198

Open vishal-biyani opened 6 years ago

vishal-biyani commented 6 years ago

Currently compose pre-built in some built in functions like foreach. For example the $.Tasks.DataValidator.Output in below workflow is always a list - which is list of individual outputs of DataValidator.

DataValidator:
    run: foreach
    inputs:
      foreach: "{ output('DataProducer') }"
      do:
        run: cpvalidator
        inputs:
          body: "{ task().Inputs._item }"
    requires:
    - DataProducer

CarpoolAllocator:
    run: cpallocator
    inputs: "{ $.Tasks.DataValidator.Output }"
    requires:
    - DataValidator

In some cases user may want to have a slightly different compose behaviour. For example instead of creating a list of outputs of DataValidator - you may want the CarpoolAllocator be called individually for each output.