From 80e5bc6887965a35ca1ab2794e4e4a96c0ef7a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Duarte?= Date: Wed, 23 Oct 2024 21:49:00 +0100 Subject: [PATCH] Fix workflow trigger params serialization (#7075) * feat: change trigger command to comply with new endpoint * fix: fix workflow trigger command param serialization --- .changeset/tasty-kangaroos-bake.md | 7 +++++++ packages/wrangler/src/workflows/commands/trigger.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/tasty-kangaroos-bake.md diff --git a/.changeset/tasty-kangaroos-bake.md b/.changeset/tasty-kangaroos-bake.md new file mode 100644 index 000000000000..e27d0b8ca29a --- /dev/null +++ b/.changeset/tasty-kangaroos-bake.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +Fix params serialization when send the trigger workflow API + +Previously, wrangler did not parse the params sending it as a string to workflow's services. diff --git a/packages/wrangler/src/workflows/commands/trigger.ts b/packages/wrangler/src/workflows/commands/trigger.ts index 6b5ae47f5b8e..a288cd0e8f3f 100644 --- a/packages/wrangler/src/workflows/commands/trigger.ts +++ b/packages/wrangler/src/workflows/commands/trigger.ts @@ -54,7 +54,7 @@ defineCommand({ headers: { "Content-Type": "application/json" }, body: JSON.stringify({ instance_id: args.id, - params: args.params.length != 0 ? args.params : undefined, + params: args.params.length != 0 ? JSON.parse(args.params) : undefined, }), } );