Node.js: ffmpeg command not waiting for other ffmpeg command promise to be resolved

I am trying to node.js program, in which fluent-ffmpeg first converts an input-mp4-file to an mp3 file and after that fluent-ffmpeg command should trim the mp3 file (for example only 0:12 – 0:48).
I am using promises for that but it seems like that the trimFile() method is not waiting for the promise to be resolved. I have the following code:

// data = [stream, duration, trimStartTime, res, name]
async function convertMP4ToMP3(data) {
    var name = data[4];
    let inputFilePath = `./temp/${name}.mp3`
    return new Promise((resolve, reject) => {
        ffmpeg()
            .input(`./temp/${name}.mp4`)
            .output(`./temp/${name}.mp3`)
            .audioCodec('libmp3lame')
            .on('error', reject)
            .run();
        console.log("convertMP4toMP3 DONE!n");
        resolve(data.concat([inputFilePath]));
    });
}

// data = [stream, duration, trimStartTime, res, name, inputFilePath]
async function trimFile(data) {
        console.log("trimming starting");
  return new Promise((resolve, reject) => {
      setTimeout(() => {
    let duration = data[1];
    if (duration > 0) {
    let trimStartTime = data[2];
    let inputFilePath = data[5];

    var dotIndex = inputFilePath.lastIndexOf(".");
    var outputFilePath = inputFilePath.substring(0, dotIndex) + "_t" + inputFilePath.substring(dotIndex);
   
    const trim = new ffmpeg({source: inputFilePath});
    trim
        .setStartTime(trimStartTime)
        .setDuration(duration)
        .on("start", function(commandLine) {
            console.log("Spawned ffmpeg with: " + commandLine)
        })
        .on('end', function(err) {
                if (!err) {
                    console.log('trimming Done');
                }
            })
        .on('error', function(err) {
                console.log('error in trimFile(): ', err);
            })
        .saveToFile(outputFilePath);
   
    }        
    resolve(data);
    }, "100");  // explanation underneath
    });
}

If I execute the following code:

func1(data)
        .then(func2)
        .then(convertMP4ToMP3)
        .then(trimFile)

The trimfile() method says: Invalid argument. If I change the timeout to 6000 instead of 100. It works. I was spectating the files in the filesystem and saw, that convert sometimes is not done before trimFile is executed. Can someone explain, why the trimFile() is not waiting for the resolve()?

I also tried:

// data = [stream, duration, trimStartTime, res, name]
async function convertMP4ToMP3(data) {
    var name = data[4];
    let inputFilePath = `./temp/${name}.mp3`
    return new Promise((resolve, reject) => {
        ffmpeg()
            .input(`./temp/${name}.mp4`)
            .output(`./temp/${name}.mp3`)
            .audioCodec('libmp3lame')
            .on('error', reject)
            .on('end', resolve)
            .run();
        console.log("convertMP4toMP3 DONE!n");
    });
}

But first this doesnt work neither and second thus I can not pass the string inputFilePath to the trimfile() method (because .on(‘end’, resolve(data.concat([inputFilePath]))) does not work for me).