Closed
Description
opened on Mar 15, 2024
I've created this pipeline that uses max_concurrency
in an input step:
pipeline "multi_step" {
param "prompt" {
default = "Do you approve?"
}
param "subject" {
default = "Do you approve?"
}
param "notifiers" {
default = ["default"]
}
step "input" "approve" {
for_each = param.notifiers
max_concurrency = 1
notifier = notifier[each.value]
type = "button"
subject = param.subject
prompt = param.prompt
option "approve" {
label = "Approve"
style = "ok"
}
option "deny" {
label = "Deny"
style = "alert"
}
}
output "approved" {
value = alltrue([for decision in step.input.approve : decision.value == "approve"])
}
}
But, when I run it all the inputs are started at the same time:
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [test] Starting
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [test.square_it] Starting pipeline
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [test.square_it] Arg args = {
"flow": "multi_step",
"notifiers": [
"foo",
"bar",
"baz"
],
"prompt": "Should I square 2?"
}
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [test.square_it] Arg pipeline = approval.pipeline.approve
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve] Starting
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve] Arg flow = multi_step
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve] Arg notifiers = [
"foo",
"bar",
"baz"
]
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve] Arg prompt = Should I square 2?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve.run_approval] Starting pipeline
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve.run_approval] Arg args = {
"notifiers": [
"foo",
"bar",
"baz"
],
"prompt": "Should I square 2?",
"subject": "Do you approve?"
}
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [approve.run_approval] Arg pipeline = approval.pipeline.multi_step
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step] Starting
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step] Arg notifiers = [
"foo",
"bar",
"baz"
]
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step] Arg prompt = Should I square 2?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step] Arg subject = Do you approve?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[1]] Starting input: http://localhost:7103/form/cnq1r8so47mpq5o92k9g/28r2a50i4t5p2
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[1]] Arg notifier = {
"notifies": [
{
"integration": {
"type": "http"
}
}
]
}
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[1]] Arg options = [
{
"label": "Approve",
"style": "ok",
"value": "approve"
},
{
"label": "Deny",
"style": "alert",
"value": "deny"
}
]
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[1]] Arg prompt = Should I square 2?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[1]] Arg subject = Do you approve?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[1]] Arg type = button
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[2]] Starting input: http://localhost:7103/form/cnq1r8so47mpq5o92ka0/3a0qhibxw32k9
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[2]] Arg notifier = {
"notifies": [
{
"integration": {
"type": "http"
}
}
]
}
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[2]] Arg options = [
{
"label": "Approve",
"style": "ok",
"value": "approve"
},
{
"label": "Deny",
"style": "alert",
"value": "deny"
}
]
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[2]] Arg prompt = Should I square 2?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[2]] Arg subject = Do you approve?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[2]] Arg type = button
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[0]] Starting input: http://localhost:7103/form/cnq1r8so47mpq5o92k90/0go8m9svx7ywb
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[0]] Arg notifier = {
"notifies": [
{
"integration": {
"type": "http"
}
}
]
}
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[0]] Arg options = [
{
"label": "Approve",
"style": "ok",
"value": "approve"
},
{
"label": "Deny",
"style": "alert",
"value": "deny"
}
]
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[0]] Arg prompt = Should I square 2?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[0]] Arg subject = Do you approve?
2024-03-15 06:06:27 exec_cnq1r8so47mpq5o92k3g [multi_step.approve[0]] Arg type = button
Given the max_concurrency
setting, I'd expect to only get prompted for one input at a time?
Activity