Skip to main content
Version: 2.8

4 Examples

4.1 Simple example

Definition of a workflow can be defined in ews/simple.ews and can looks like this:

Run job/example.1.evl job/example.2.sh
Run job/example.3.sh
End

As this workflow has no parameters, the file workflow/simple.ewf will be empty. To fire this workflow run in command line:

evl run workflow/simple.ewf

It runs jobs example.1.evl and example.3.sh in parallel, and once example.1.evl finish successfully, fires also example.2.sh. When all jobs finish successfully, workflow is successful as well.

4.2 Example with retries and maximal run time check

Slightly advanced workflow definition might look like this:

Run 2h    job/common_job.sh  --project=/full/path/to/other/project \
4h 2r job/stage.invoices.evl
End

which means to run common_job.sh from other project and kill the job and fail if not finished within 2 hours.

If common_job.sh finish successfully then run job/stage.invoices.evl. Fail if (each run) does not finish within 4 hours, but try to restart two times in case of failure.

4.3 Examples with waiting for file to exist

Following workflow definition says to wait at most 1 day for any file of the mask /data/landing/invoice.????????.csv on local machine. Once such file appears job/stage.invoices.evl is fired. When no such file exist even after 24 hours, workflow fails.

Run 1d w /data/landing/invoice.????????.csv \
job/stage.invoices.evl
End

The same example but waiting for a file to be delivered on remote location, here on AWS S3:

export AWS_PROFILE="landing_zone"
Run 1d w s3://some_bucket/data/landing/invoice.????????.csv \
job/stage.invoices.evl
End

The same example but waiting for a file to be delivered on remote machine, here connected over sftp:

EVL_RUN_SSH_OPTS="-i $HOME/.ssh/id_rsa"

Run 1d w sftp://some_user@some_host:22/data/landing/invoice.????????.csv \
job/stage.invoices.evl
End

And the same ‘sftp’ example, but shifting the regular checking of existence of the file to the remote machine:

EVL_RUN_SSH_USER="some_user"
EVL_RUN_SSH_HOST="some_host"
EVL_RUN_SSH_PORT=22
EVL_RUN_SSH_OPTS="-i $HOME/.ssh/id_rsa"

Run --target ssh 1d w /data/landing/invoice.????????.csv
Wait
Run job/stage.invoices.evl
End

But in this case remote monitor database has to be set up. To run the “job/stage.invoices.evl“ still on local machine, separate “Run‘ command has to be used.