Mar 11, 2021
I tried in Node (and I'm bad in Node) and I can propose you this piece of working code
const {WorkflowsClient} = require('@google-cloud/workflows');
const client = new WorkflowsClient();
const [workflows] = await client.listWorkflows({
parent: client.locationPath("<PROJECT_ID>", "us-central1"),
});
for (const workflow of workflows) {
console.info(`name: ${workflow.name}`);
}
const {ExecutionsClient} = require('@google-cloud/workflows');
const execclient = new ExecutionsClient();
const [resp] = await execclient.createExecution({
parent: client.workflowPath("<PROJECT_ID>", "us-central1", "run-long-process"),
execution: {
argument: '{"wait":5}'
}
});
console.info(`name: ${resp.name}`);