{"id":20642002,"url":"https://github.com/opsbr/cdk-appsync-data-source-sfn-express","last_synced_at":"2025-09-25T18:37:38.809Z","repository":{"id":63973528,"uuid":"571568366","full_name":"opsbr/cdk-appsync-data-source-sfn-express","owner":"opsbr","description":"A CDK construct to create an AWS AppSync data source to call AWS Step Functions express workflows.","archived":false,"fork":false,"pushed_at":"2023-05-18T00:05:56.000Z","size":196,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T01:48:55.181Z","etag":null,"topics":["appsync-resolvers","cdk","step-functions"],"latest_commit_sha":null,"homepage":"https://constructs.dev/packages/@opsbr/cdk-appsync-data-source-sfn-express/","language":"TypeScript","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/opsbr.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,"zenodo":null}},"created_at":"2022-11-28T12:18:07.000Z","updated_at":"2023-05-07T11:36:02.000Z","dependencies_parsed_at":"2025-07-11T05:02:58.482Z","dependency_job_id":"7cdb83b9-e334-4bd8-ac35-b90b264b2025","html_url":"https://github.com/opsbr/cdk-appsync-data-source-sfn-express","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/opsbr/cdk-appsync-data-source-sfn-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsbr%2Fcdk-appsync-data-source-sfn-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsbr%2Fcdk-appsync-data-source-sfn-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsbr%2Fcdk-appsync-data-source-sfn-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsbr%2Fcdk-appsync-data-source-sfn-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opsbr","download_url":"https://codeload.github.com/opsbr/cdk-appsync-data-source-sfn-express/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsbr%2Fcdk-appsync-data-source-sfn-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276966311,"owners_count":25736754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-25T02:00:09.612Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["appsync-resolvers","cdk","step-functions"],"created_at":"2024-11-16T16:07:36.846Z","updated_at":"2025-09-25T18:37:38.755Z","avatar_url":"https://github.com/opsbr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/@opsbr%2Fcdk-appsync-data-source-sfn-express.svg)](https://badge.fury.io/js/@opsbr%2Fcdk-appsync-data-source-sfn-express) [![release](https://github.com/opsbr/cdk-appsync-data-source-sfn-express/actions/workflows/release.yml/badge.svg)](https://github.com/opsbr/cdk-appsync-data-source-sfn-express/actions/workflows/release.yml)\n\n# cdk-appsync-data-source-sfn-express\n\nA CDK construct to create an AWS AppSync data source to call AWS Step Functions express workflows.\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40opsbr%2Fcdk-appsync-data-source-sfn-express)](https://constructs.dev/packages/@opsbr/cdk-appsync-data-source-sfn-express)\n## What is this?\n\nThis construct provides an HTTP data source for AWS AppSync that uses IAM authentication and\ncalls AWS Step Functions API - `StartSyncExecution`. This is a stop-gap solution until AWS\nprovides a native integration with this API like they have for AWS Lambda or Amazon DynamoDB.\n\nThen, the construct can easily create a resolver to call this API, which means you can build\nAppSync GraphQL API by running a Step Functions state machine synchronously just like Amazon\nAPI Gateway already has, too.\n\nAlso, this is a showcase for how to use HTTP data source for non-RESTful AWS endpoints.\n\n## Usage\n\n```typescript\ndeclare const api: appsync.CfnGraphQLApi;\ndeclare const stateMachine: stepfunctions.StateMachine;\n\nconst schema = new appsync.CfnGraphQLSchema(stack, 'Schema', {\n  apiId: api.attrApiId,\n  definition: `\n    type Query {\n      getPost(id: Int): Post\n    }\n    type Post {\n      id: Int\n      title: String\n    }\n  `,\n});\n\nconst sfnExpressDataSource = new AppSyncDataSourceStepFunctionsExpress(stack, 'SfnExpressDataSource', {\n  apiId: api.attrApiId,\n});\n\nsfnExpressDataSource.createStateMachineResolver('Resolver', {\n  stateMachine,\n  schema,\n  typeName: 'Query',\n  fieldName: 'getPost',\n});\n```\n\nWhen queried, the specified state machine receives input as the arguments of `getPost()` e.g.:\n\n```graphql\nquery MyQuery {\n  getPost(id: 1)\n}\n```\n\nis transformed to:\n\n```json\n{\n  \"id\": 1\n}\n```\n\nAnd the state machine should return the output like below:\n\n```json\n{\n  \"id\": 1,\n  \"title\": \"Hello world!\"\n}\n```\n\nThen, AppSync returns the output as the return type of the query:\n\n```graphql\n{\n  \"data\": {\n    \"getPost\": {\n      \"id\": 1,\n      \"title\": \"Hello world!\"\n    }\n  }\n}\n```\n\n## Notes\n\n- The state machine must be EXPRESS type. See [Step Functions document](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html) for more details.\n- Currently, this construct doesn't have a good error handling on the response mapping.\n  - We need to handle the case when the workflow fails because `StartSyncExecution` returns 200. See [Step Functions document](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartSyncExecution.html).\n\n## Authors\n\nOpsBR Software Technology Inc. Visit our website: [https://opsbr.com](https://opsbr.com)\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsbr%2Fcdk-appsync-data-source-sfn-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopsbr%2Fcdk-appsync-data-source-sfn-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsbr%2Fcdk-appsync-data-source-sfn-express/lists"}