Commit a622ff6
feat(workflows): http step type (webhook alias) with retries (#2641)
* feat(workflows): add webhook step type with timeouts and retries
Add a native `type: webhook` step for workflows and custom commands that
performs an HTTP request (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS) with
query-string parameters, headers, and a request body (raw or form/JSON).
Requests get a per-attempt timeout and retries that compose with the
existing `retry:` policy. Because extended/registry step types are not
wrapped by the legacy retry.Do path, the handler applies retry itself via
retry.WithPredicate with HTTP-aware classification: transport errors, 5xx,
and 429 retry by default; other 4xx fail fast; retry.conditions regexes
force additional cases. Success criteria are configurable via expect.status
and expect.response (regex). The response body and status are captured as
step value/metadata for downstream steps.
Includes schema fields on WorkflowStep and Task, JSON manifest updates,
docs, an example, a changelog blog post, and a roadmap milestone.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(workflows): address review feedback on webhook step
- Replace dynamic fmt.Errorf returns with static sentinel errors
(ErrTemplateEvaluation / ErrWebhookRequestFailed) per the static-error
contract.
- Bound webhook response-body reads with io.LimitReader (4 MiB) to avoid
memory blowups on large/error responses.
- Reject relative URLs in buildWebhookRequest so they fail fast instead of
being retried as transport errors.
- Add OPTIONS to the Method field comment to match supported verbs.
- Add mustGetWebhookHandler helper asserting registration; move ParseForm
assertion out of the httptest handler goroutine.
- Expand tests to cover error/helper paths, raising patch coverage above the
80% gate.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(workflows): rename webhook step type to http (webhook alias)
The step is a general-purpose, verb-agnostic outbound HTTP client, not an
inbound webhook receiver. Rename the canonical type to `http` and keep
`webhook` as a working alias for the fire-a-notification use case.
- Add first-class alias support to the step registry: NewBaseHandler is now
variadic for aliases, Get() resolves aliases, and List/Count report only the
canonical entry (no duplicate step). Aliases are exposed via an optional
GetAliases() interface so the StepHandler interface (and its mock) are
unchanged.
- Rename webhook.go/test/e2e -> http*.go and all Webhook*/webhook* symbols to
HTTP*/http*; register as "http" with "webhook" alias.
- Rename WebhookExpect -> HTTPExpect (workflow.go, task.go) and the 7
ErrWebhook* sentinels -> ErrHTTPStep* in errors/errors.go.
- JSON manifest: url-required conditional now matches type in [http, webhook];
descriptions updated to "http step type".
- Rename example examples/workflow-webhook -> examples/http-webhooks (type:
http, webhook noted as alias).
- Docs/blog/roadmap: step-types reference, retry.conditions link, blog slug
http-step-type, roadmap changelog slug; all note the webhook alias.
- Add a contract test asserting the webhook alias resolves to the http handler
and is not listed as a distinct step type.
- Drive-by: extract a const for a repeated "secret %s" literal in
azure_keyvault_store.go to satisfy the repo-wide lint hook.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(workflows): make http transport error test deterministic
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 33f92ff commit a622ff6
18 files changed
Lines changed: 1974 additions & 9 deletions
File tree
- errors
- examples/http-webhooks
- workflows
- pkg
- datafetcher/schema/atmos/manifest
- runner/step
- schema
- website
- blog
- docs/workflows
- _partials
- workflows/workflow/steps
- type
- src/data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
660 | 667 | | |
661 | 668 | | |
662 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1401 | 1408 | | |
1402 | 1409 | | |
1403 | 1410 | | |
| |||
1426 | 1433 | | |
1427 | 1434 | | |
1428 | 1435 | | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1429 | 1503 | | |
1430 | 1504 | | |
1431 | | - | |
1432 | | - | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1433 | 1531 | | |
1434 | 1532 | | |
1435 | 1533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| |||
0 commit comments