diff --git a/bam2fastx.wdl b/bam2fastx.wdl
index 42240cd4da789985ca1d84ec86973f833f15672b..18434755f251ee91df8a10e36eac3990fbd51217 100644
--- a/bam2fastx.wdl
+++ b/bam2fastx.wdl
@@ -91,12 +91,25 @@ task Bam2Fastq {
     command {
         set -e
         mkdir -p "$(dirname ~{outputPrefix})"
+
+        # Localise the bam and pbi files so they are next to each other in the
+        # current folder
+        bamfiles=""
+        for bamfile in ~{sep=" " bam};do
+            ln $bamfile .
+            bamfiles=$bamfiles" $(basename $bamfile)"
+        done
+
+        for bamindex in ~{sep=" " bamIndex}; do
+            ln $bamindex .
+        done
+
         bam2fastq \
         --output ~{outputPrefix} \
         -c ~{compressionLevel} \
         ~{true="--split-barcodes" false="" splitByBarcode} \
         ~{"--seqid-prefix " + seqIdPrefix} \
-        ~{sep=" " bam}
+        $bamfiles
     }
 
     output {