我试图在执行谷歌云工作流程时包含运行时变量。除非您使用 REST API,否则我找不到执行此操作的文档。
这是我的代码,主要来自他们的文档,我只是得到了 null 参数。我认为这可能是它在 createExecution 上期望的第二个参数,名为执行,但我无法弄清楚。
const { ExecutionsClient } = require('@google-cloud/workflows');
const client = new ExecutionsClient();
const execute = () => {
return client.createExecution(
{
parent: client.workflowPath('project_id', 'location', 'name'),
},
{
argument: {
users: ['info here'],
},
},
);
};
module.exports = execute;
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助!