arcRoot=$1
cwlPattern=$2
outWflList=$3
outGraphs=$4

find "$arcRoot"/ -name "$cwlPattern" > "$outWflList"

mkdir -p "$outGraphs"

while IFS= read -r wfl; do
    dirname "$wfl" | xargs basename | xargs read wflname
    cwltool --print-dot "$wfl" | dot -Tsvg > "$outGraphs"/"$wflname".svg
done < "$outWflList"


