Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Can't invoke a state machine from a state machine (nested workflows) #82

Description

@smcroskey

I have a simple state machine using the AWS CDK adapter with cdktf where I am trying to use nested workflows via the StepFunctionsStartExecution optimized integration.

        // create child state machine
        const manualReviewStateMachine = new StateMachine(...)

       // in the parent state machine...
        return new sfnTasks.StepFunctionsStartExecution(this.scope, `Manual Review`, {
            stateMachine: manualReviewStateMachine,
            integrationPattern: IntegrationPattern.RUN_JOB,
            input: sfn.TaskInput.fromObject({...})
        })

However, the cdktf JSON output doesn't appear to be valid because the reference to the child state machine uses a Ref attribute that doesn't exist (modified the TF json output slightly to make it more readable, but the key is the "Ref" attribute in the StateMachineArn field value for the Manual Review state):

"Manual Review":{
    "Next": "...",
    "Type": "Task",
    "Resource": join("", "arn:", data.aws_partition.aws-adapter_aws-partition_68D67DE5.partition, ":states:::states:startExecution.sync:2"),
    "Parameters": {
        "Input": { ... },
        "StateMachineArn": jsondecode(aws_cloudcontrolapi_resource.aws-adapter_ParallelComplianceLegalEntityReviewManualReviewStateMachine0B6709C9_D8D91C4C.properties)["Ref"]
    }
}

If I try to deploy, it complains about a missing Ref attribute. Note that if I change the Ref above to Arn and deploy, it deploys successfully. It seems that the StateMachine mapping for the AWS CDK adapter must not be including the Ref attribute?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions