$string switched to exponent notation at Long.MAX_VALUE, so $string(1e20)
returned "1e+20" where AWS returns "100000000000000000000". AWS's boundary is
1e21, on both signs. The execution succeeds either way, so a $string used as a
MessageGroupId, an S3 key or a DynamoDB key wrote a different key on each engine
without either reporting an error.
$string is now bound on the evaluation frame next to the six functions of the
Step Functions dialect, with the library's own signature so every arity and type
error stays what it was. Below the boundary a double is replaced by the exact
integer of the shortest decimal that reads back as it, which is the digit string
AWS prints; the library formats everything else.
Closes#2669
Co-authored-by: Facundo Paredes <25681464+facuparedes@users.noreply.github.com>
Step Functions extends JSONata with $parse, $partition, $range, $hash,
$random and $uuid. None of them exist in the JSONata language, so an
expression calling one failed with "Attempted to invoke a non-function"
and the execution failed with States.QueryEvaluationError.
Bind the six on the evaluation frame next to $states and the workflow
variables. Behaviour follows AWS on the cases a naive reading gets wrong:
a non-integer argument rounds towards zero, several argument combinations
evaluate to undefined instead of failing, $range collapses a
single-element range to a bare number, $parse rejects the JSON AWS
rejects, and $random(seed) reproduces java.util.Random.
Verified with a 65-expression differential against real AWS Step
Functions: 65 match, 0 differ.
Co-authored-by: Facundo Paredes <25681464+facuparedes@users.noreply.github.com>
* feat(sfn): support mocked service integrations (SFN_MOCK_CONFIG)
StartExecution accepts a state machine ARN with a test case suffix in
the Step Functions Local format. The test case comes from the mock
configuration file named by SFN_MOCK_CONFIG. A mocked Task state
returns the configured Return payload or fails with the configured
Throw error instead of calling the integrated service. The mocked
error and cause reach Retry and Catch unchanged. States not named in
the test case still call their real integration, so mocked and real
calls combine in one execution. Behavior was verified against Step
Functions Local 2.0.0.
Closes#2283
* fix(sfn): never retry or catch States.Runtime even when named explicitly
* fix(sfn): keep a bare trailing '#' unstripped on StartSyncExecution
* feat(sfn): honor Retry policies in the ASL executor
Task, Parallel, and Map states previously ignored their Retry field, so
any failure went straight to Catch or failed the execution. They now
retry per the ASL spec. ErrorEquals matching reuses the Catch matcher,
including the States.ALL and States.TaskFailed wildcards, and
States.Runtime is never retried. AWS defaults apply when fields are
omitted (MaxAttempts 3, IntervalSeconds 1, BackoffRate 2.0).
MaxDelaySeconds is honored. Each retrier keeps its own attempt counter
and an exhausted retrier falls through to Catch. The context object
field $$.State.RetryCount increments per attempt.
Attempt counts, defaults, backoff timing, retry before catch order,
and per attempt RetryCount resolution were verified against real AWS
Step Functions in us-east-1 using execution histories.
Two deviations are documented. The delay between attempts is capped at
30 seconds, matching the cap Floci applies to Wait states.
JitterStrategy is accepted but ignored.
Refs #2283
* test(sfn): add end-to-end Retry integration tests
Covers the JSON 1.0 wire protocol path. The fail-then-succeed case
works without mocks by resolving the DynamoDB table name from
$$.State.RetryCount, so attempt 0 targets a missing table and the
retry targets one that exists. This also exercises per attempt
Parameters re-resolution, which real AWS does the same way. The other
cases cover retrier exhaustion falling through to Catch and an
unmatched error failing without retry.
* fix(sfn): unwrap branch failures so Parallel Retry and Catch apply
* fix(sfn): isolate the context object per Parallel branch and per branch state
* fix(sfn): fail a missing Lambda function as Lambda.ResourceNotFoundException
* test(sfn): cover Retry and Catch for Parallel and Map states
* feat(sfn): support JitterStrategy FULL in Retry backoff
* fix(sfn): keep branch Error causes wrapped so executions still terminate
* feat(stepfunctions): run Map iterations concurrently honoring MaxConcurrency
A Map state ran its iterations one after another. AWS runs them
concurrently up to MaxConcurrency (default 0 = unlimited), which is a
correctness requirement, not just a speed-up: a Map whose iterations
coordinate — e.g. a dependency-ordered fan-out where one child blocks
until a sibling completes — deadlocks when the iterations are serialised.
Run each iteration on the shared executor under the execution's account,
gated by a Semaphore sized to MaxConcurrency (unlimited when 0). Results
are written into per-index slots so the output array preserves input order
regardless of completion order, MaxConcurrency=1 stays strictly sequential,
and a failed iteration cancels the rest and fails the Map (fail-fast,
matching the default ToleratedFailureCount of 0).
* fix(stepfunctions): cap Map worker threads with a bounded pool + handle interruption
Address review: submitting every iteration to the shared cached pool behind
a Semaphore spawned one thread per item (a 1000-item Map with
MaxConcurrency=5 created ~1000 threads, ~995 parked). Run iterations on a
fixed-size per-Map ThreadPoolExecutor sized to MaxConcurrency so live
threads are capped and the rest queue. shutdownNow() in finally stops the
iterations on any exit, and an InterruptedException from the driver now
preserves the interrupt status.
* fix(stepfunctions): make Map concurrency bounded and fail-fast
* docs(stepfunctions): document map concurrency
* test(dynamodb): retain Quarkus port for cleanup
* chore: rerun CI after OpenTofu registry flake
* test(stepfunctions): pin Map item selection order
* feat(docs): generate Supported Actions tables from handler source
The "Supported Actions" tables in docs/services/*.md were hand-maintained and
drifted from the handlers. For example secrets-manager.md omitted RestoreSecret,
which SecretsManagerJsonHandler dispatches, and acm.md listed RenewCertificate,
which is not implemented anywhere in src/.
Derive the action list from handler source so it cannot drift, while keeping the
hand-written Description column:
- tools/docs/regen_action_docs.py extracts actions from `case "X" ->` switch arms
(including multi-label arms) and JAX-RS REST controllers, and rewrites only the
rows between the <!-- floci:actions --> markers. Descriptions are preserved by
action name; new actions get a "-" placeholder. PascalCase-only matching avoids
picking up SCREAMING_CASE labels from non-action switches.
- tools/docs/services.yaml registers 18 single-table switch services and lists the
remaining switch handlers under deferred_handlers, so the new-service sentinel
fires only on a genuinely unregistered handler.
- make docs-sync / docs-check / docs-test, plus a Python-only CI workflow that
gates on handler, doc, and tooling changes.
- Migrate 18 service docs into marker blocks, reconciling real drift (adds
RestoreSecret, ImportCertificate, and others; drops the unimplemented
RenewCertificate).
Revives the parser and CI gate from #738 by @ericbsantana and completes the
description-preservation its spec described. REST-mode, mixed-mode, multi-table,
non-tabular, S3, and ecr docs are deferred and tracked in deferred_handlers.
* docs: drop standalone design spec from action-docs tooling
Remove ideas/auto-generated-action-tables.spec.md and the four references
to it (CONTRIBUTING.md, Makefile, regen_action_docs.py docstring,
services.yaml). It was a planning artifact; the operational docs live in
CONTRIBUTING.md and the tooling is self-documenting. The #738 / @ericbsantana
credit is preserved in the PR description.
* chore: address review on action-docs tooling
- pin actions/checkout to v7.0.0 in docs-actions workflow to match the
repo-wide bump (#1690), so dependabot does not immediately flag the new file
- document in the generator docstring that a switch case label counts as
supported purely by existing, so a per-action UnsupportedOperation stub
would be a false positive (handlers here reject from the default arm)
* docs: regenerate action tables against current handler source
Resync the generated Supported Actions tables to handler source after
rebasing onto the latest main:
- cloudformation: add DescribeStackInstance and DescribeStackSetOperation
now emitted by the handler, and keep the implemented StackSet descriptions
- cloudtrail: add LookupEvents
- firehose: add UpdateDestination
- step-functions: add PublishStateMachineVersion, ListStateMachineVersions,
DeleteStateMachineVersion
- register the cloudcontrol handler in deferred_handlers so the strict
unregistered-handler gate passes (no standalone action table yet)
* fix(docs): prevent action-table generator from silently dropping actions
Address the latest review pass on the action-docs tooling:
- switch extraction now captures case arms whose labels wrap across lines
(valid Java 14+ syntax). The capture group excludes only `{ } ;` boundaries,
so it spans newlines between labels but stops at the arm's `->`. A wrapped
arm was previously missed, and docs-check would stay green because the doc
and the generated output agreed on the omission, defeating the whole
drift-prevention guarantee.
- REST extraction skips Javadoc / inline comments between a verb annotation
and the method signature; such a line otherwise reset the lookahead and
dropped the action.
- parse_marker_block raises a descriptive error when a marker is not on its
own line, instead of a bare "substring not found".
- doc, source, and registry reads/writes are pinned to UTF-8 so generation is
locale-independent (the docs contain non-ASCII text).
- the docs-actions push trigger watches Makefile and the workflow file,
matching its pull_request trigger.
Adds regression tests for the multi-line arm and comment-skip paths (20 total).
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs
had drifted from code behaviour. This sweep reconciles docs against the
current codebase on upstream/main.
- Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history
- Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58),
Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the
actual dispatch handlers rather than @Path annotation counts.
- Rewrite README "Supported Services" table to drop per-service op counts
(they drift too fast); point readers at docs/services/index.md
- Update 24 service docs for accuracy, add "Not Implemented" sections
where relevant (s3.md, lambda.md, api-gateway.md)
- Refresh configuration and getting-started docs
- Add EventBridge Scheduler and AppConfig to mkdocs nav
- Add AppConfig / AppConfigData rows to README and services index
following the 1.5.2 upstream release