StepFunction: How to add a date run condition on the parallel state of State Machine #18250
Closed
sandycoolsash
started this conversation in
General
Replies: 1 comment
-
This is a question best asked of the state function team, not the CDK. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have state machine which has a bunch of task and parallel state. I have my state machine schedule to run daily but i want my parallel state to only start when its 22nd of the month and rest all days of the month the parallel state should skip/not run.
Any idea/suggestion how i can get this implemented

ASL Definition
{
"StartAt": "Choice State Name?",
"States": {
"Choice State Name?": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.StateName",
"IsPresent": false,
"Next": "Daily_Job_1"
},
{
"Variable": "$.StateName",
"StringEquals": "Daily_Job_1",
"Next": "Daily_Job_1"
},
{
"Variable": "$.StateName",
"StringEquals": "Parallel_Chain",
"Next": "Parallel_Chain"
},
{
"Variable": "$.StateName",
"StringEquals": "Daily_Job_3",
"Next": "Daily_Job_3"
}
],
"Default": "Job Failed"
},
"Job Failed": {
"Type": "Fail",
"Error": "!!! Start Job Name passed is not correct and not matched the defined rule",
"Cause": "Rule not matched for Start Job Name"
},
"Daily_Job_1": {
"Next": "Parallel_Chain",
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_1",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
},
"Parallel_Chain": {
"Type": "Parallel",
"ResultPath": null,
"Next": "Daily_Job_3",
"Branches": [
{
"StartAt": "Daily_Job_2a",
"States": {
"Daily_Job_2a": {
"Next": "Daily_Job_2b",
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_2a",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
},
"Daily_Job_2b": {
"End": true,
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_2b",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
}
}
},
{
"StartAt": "Daily_Job_2c",
"States": {
"Daily_Job_2c": {
"Next": "Daily_Job_2d",
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_2c",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
},
"Daily_Job_2d": {
"Next": "Daily_Job_2e",
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_2d",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
},
"Daily_Job_2e": {
"End": true,
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_2e",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
}
}
}
]
},
"Daily_Job_3": {
"End": true,
"Type": "Task",
"ResultPath": null,
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "arn:aws:batch:us-west-2:XXXXX:job-definition/dataservices-batch-job-definition-poc:1",
"JobName": "Daily_Job_3",
"JobQueue": "arn:aws:batch:us-west-2:XXXXX:job-queue/getting-started-job-queue-batch-poc",
"ContainerOverrides": {}
}
}
},
"TimeoutSeconds": 7200
}
Beta Was this translation helpful? Give feedback.
All reactions