An error occurred: Check - Invalid State Machine Definition: 'MISSING_TRANSITION_TARGET: Missing 'Next' target: aws_own.run_step at /StartAt, MISSING_TRANSITION_TARGET: State "run_step" is not reachable. at /States/run_step'

I have been getting this error during stack update in sls deploy. It’s a python project. I’m new to step functions. Please help.

Complete Error :

An error occurred: Check - Invalid State Machine Definition: ‘MISSING_TRANSITION_TARGET: Missing ‘Next’ target: aws_own.run_step at /StartAt, MISSING_TRANSITION_TARGET: State “run_step” is not reachable. at /States/run_step’ (Service: AWSStepFunctions
; Status Code: 400; Error Code: InvalidDefinition; Request ID: 664d)

service: p-step-test

custom:
Hidden

provider:
Hidden

environment:
ROLLBAR_TOKEN: {self:custom.rollbarToken} ROLLBAR_ENV: {self:provider.stage}
SECRET1: ${self:custom.secretName}

memorySize: 128
timeout: 30

apiKeys:
- {self:service}-{self:provider.stage}
usagePlan:
quota:
limit: 50000
offset: 2
period: WEEK
throttle:
burstLimit: 200
rateLimit: 100
apiGateway:
apiKeySourceType: HEADER

package:
exclude:
- env/**
- venv/**
- .git/**
- ‘.pyc’ # if using python 2.x
- .aws-sam/**
- .idea/**
- sam/**
- '
.sh’
- node_modules/**
- lib/**
- local_events/**
- unit_tests.db
- tests/unit_tests.db
- flask/**

plugins:

  • serverless-python-requirements
  • serverless-tag-api-gateway
  • serverless-step-functions

functions:

runStepFunction:
handler: aws_own.run_step
events:
- http:
path: /step/ownership/id/{id}
method: get

stepFunctions:
stateMachines:
Check:
name: check
definition:
Comment: “Testing step function”
StartAt: aws_own.run_step
States:
run_step:
Type: Task
Resource: arn:aws:lambda:{self:provider.region}:{self:custom.awsAccountId}:function:p-step-test-rt
Next: EndState
EndState:
Type: Succeed

resources:
Hidden