Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

This parameters template demonstrates the Start Step Functions Execution action:

JSON escaping requirements

If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

  • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

  • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

Start Step Functions Execution parameters example (escaped manually)

{
  "StateMachineArn": "arn:aws:states:ap-southeast-2:123456789012:stateMachine:sample-AutomationWithAWSQuickstartStepFunctionsStateMachine-UHDE4Y9QTDIN",
  "Input": "{ \"Event\":\"$event.simpleName\", \"Timestamp\": \"$event.timestamp\", \"TraceID\": \"$event.traceId\"}"
}

Start Step Functions Execution parameters example (escaped with utility function)

{
  "StateMachineArn": "arn:aws:states:ap-southeast-2:123456789012:stateMachine:sample-AutomationWithAWSQuickstartStepFunctionsStateMachine-UHDE4Y9QTDIN",
  "Input": "$util.escapeJson('{
    "Event": "$event.simpleName",
    "Timestamp": "$event.timestamp",
    "TraceID": "$event.traceId"
  }')"
}

  • No labels