{"id":20853715,"url":"https://github.com/wolfeidau/sfn-golang-example","last_synced_at":"2026-04-20T18:33:04.632Z","repository":{"id":136376988,"uuid":"366902042","full_name":"wolfeidau/sfn-golang-example","owner":"wolfeidau","description":"This is a basic example of how to use AWS step functions with lambda's written in Go.","archived":false,"fork":false,"pushed_at":"2023-02-25T23:54:23.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-12T21:34:49.915Z","etag":null,"topics":["aws","golang","serverless","step-functions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wolfeidau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-13T01:40:56.000Z","updated_at":"2023-02-25T23:54:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd3dfe12-2981-4e11-8dbd-e490aa20fb39","html_url":"https://github.com/wolfeidau/sfn-golang-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wolfeidau/sfn-golang-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fsfn-golang-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fsfn-golang-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fsfn-golang-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fsfn-golang-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolfeidau","download_url":"https://codeload.github.com/wolfeidau/sfn-golang-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fsfn-golang-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32059791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","golang","serverless","step-functions"],"created_at":"2024-11-18T03:22:53.742Z","updated_at":"2026-04-20T18:33:04.613Z","avatar_url":"https://github.com/wolfeidau.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sfn-golang-example\n\nThis is a basic example of how to use [AWS step functions](https://aws.amazon.com/step-functions/) with lambda's written in [Go](https://golang.org).\n\n# overview\n\nThe main things to call out features wise are:\n\n* Uses [lambda middleware](https://github.com/wolfeidau/lambda-go-extras) to setup a logger in the context, and log all input and output events while in dev.\n* Has an example of [error handling described in the Step Functions documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html) using [Catch (code)](sam/app/sfn.yaml#L131-L138) feature of step functions.\n* Illustrates how you can pass the [State Name in the input, and wrap parameters (code)](sam/app/sfn.yaml#L128-L129).\n\n# deployment\n\nBefore you start you need:\n\n1. An AWS account with a bucket in the target you can use to store packaged CFN artifacts.\n2. AWS SAM CLI installed.\n3. Go version 1.15 or higher installed.\n\n```\nSAM_BUCKET=whatever AWS_REGION=ap-southeast-2 AWS_PROFILE=myprofile make SHELL=\"sh -x\"\n```\n\nOnce deployed it will output the ARN of the step function resource which has been created.\n\nYou can then run the AWS CLI to start an execution, this one has a good name.\n\n```\nAWS_REGION=ap-southeast-2 AWS_PROFILE=myprofile aws stepfunctions start-execution --state-machine-arn YOUR_ARN_HERE --name $(uuidgen) --input '{\"Name\":\"Mark\"}'\n```\nThis results in an execution which flows without error from [Validate Name](cmd/name-sfn-lambda/main.go#L114-L125) function, onto [Greet Name](https://github.com/wolfeidau/sfn-golang-example/blob/master/cmd/name-sfn-lambda/main.go#L127-L136).\n\n![Good Name Execution](docs/images/good_name.png)\n\nYou can then run the AWS CLI to start an execution, this one has a bad name, which will trigger an error condition.\n\n```\nAWS_REGION=ap-southeast-2 AWS_PROFILE=myprofile aws stepfunctions start-execution --state-machine-arn YOUR_ARN_HERE --name $(uuidgen) --input '{\"Name\":\"Anton\"}'\n```\n\nThis results in an execution with an error triggered in the [Validate Name](cmd/name-sfn-lambda/main.go#L114-L125) function, which is then routed to the [Invalid Name](https://github.com/wolfeidau/sfn-golang-example/blob/master/cmd/name-sfn-lambda/main.go#L106-L112) function.\n\n![Bad Name Execution](docs/images/bad_name.png)\n\n# License\n\nThis example is released under the Apache License, Version 2.0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfeidau%2Fsfn-golang-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfeidau%2Fsfn-golang-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfeidau%2Fsfn-golang-example/lists"}