I am trying to setup a cloud task that calls a cloud function. I am able to setup the cloud task and I have setup some cloud functions, but I can't seem to get the cloud task to invoke the cloud function.
I am creating the task from my localhost by using this code
const serviceAccount = require('./serviceAccount.json');
const {CloudTasksClient} = require('@google-cloud/tasks');
const client = new CloudTasksClient({
credentials: serviceAccount
});
const parent = client.queuePath("my-firebase-app-name-is-here", "us-central1", "matchmaking-queue-cleanup");
const task = {
appEngineHttpRequest: {
httpMethod: 'POST',
relativeUri: '/leave-queue'
},
};
task.appEngineHttpRequest.body = Buffer.from(JSON.stringify({
id: "test"
})).toString('base64');
task.scheduleTime = {
minutes: 13
};
const request = {parent, task};
client.createTask(request).then((response) => {
console.log(`created task ${response.name}`);
}).catch(console.log);
This causes the task to show up in my console under cloud tasks.
The task keeps failing and retrying. I don't see any logs from the cloud function side.
Here's what the cloud function looks like.

Any idea what I need to do to get the cloud task to invoke the cloud function?

