• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense Keys
DeployingPackagingBuildingTestingDev ModeServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
LayersManaged InstancesWeb Apps (Lambda Web Functions)Sandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
OverviewConcepts
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. Usage
  2. App Sync
  3. Pipeline Functions

AppSync pipeline functions

The appSync.pipelineFunctions map defines AppSync pipeline functions: reusable steps, each calling one data source, that pipeline resolvers run in sequence. Use them when one GraphQL field needs several data source calls, such as an authorization check before a read, or when several resolvers share a step.

This configuration defines two functions and a resolver that runs them in order:

appSync:
  name: blog-api
  pipelineFunctions:
    authorizePost:
      dataSource: postsTable
      code: functions/authorizePost.js
    getPost:
      dataSource: postsTable
      code: functions/getPost.js
  resolvers:
    Query.getPost:
      functions:
        - authorizePost
        - getPost

Each function's code file exports request(ctx) and response(ctx), like a resolver; ctx.prev.result holds the previous function's result. functions/getPost.js:

import { util } from '@aws-appsync/utils'

export function request(ctx) {
  return {
    operation: 'GetItem',
    key: util.dynamodb.toMapValues({ id: ctx.args.id }),
  }
}

export function response(ctx) {
  return ctx.result
}

Pipeline function keys

Each key of appSync.pipelineFunctions is the function's name, which resolvers list in functions. AppSync accepts names that match [_A-Za-z][_0-9A-Za-z]*. Each function accepts these keys:

KeyTypeDefaultDescription
dataSourcestring or objectRequiredThe name of a data source in appSync.dataSources, or an inline data source.
descriptionstringNoneA description shown in the AppSync console.
codestringNonePath to a JavaScript or TypeScript file, relative to the service directory.
requeststringNonePath to a VTL request mapping template, relative to the service directory.
responsestringNonePath to a VTL response mapping template, relative to the service directory.
maxBatchSizenumber, 1–2000NoneFor Lambda data sources: the maximum number of requests AppSync sends to the function in one batch invocation.
syncobjectNoneConflict detection and resolution. See Delta Sync.
substitutionsmapNoneSee AppSync substitutions.

Pipeline function runtimes

The keys a pipeline function sets decide its runtime:

  • With code, the function runs JavaScript on the APPSYNC_JS runtime. The Framework bundles the file with esbuild, as it does for resolvers.
  • With request and/or response and no code, the function runs VTL mapping templates.
  • With none of them, the function invokes its Lambda data source directly, as a direct Lambda call. Use this only with a Lambda data source.

Inline data sources in pipeline functions

A function's dataSource can be a full data source definition, for a data source only this function uses. The inline data source, and an inline Lambda function under it, take the pipeline function's name (getPostFromLambda in this example):

provider:
  name: aws
  runtime: nodejs24.x

appSync:
  name: blog-api
  pipelineFunctions:
    getPostFromLambda:
      dataSource:
        type: AWS_LAMBDA
        config:
          function:
            handler: functions/getPost.handler

A function that only one resolver uses can also be defined inside that resolver's functions list; see inline pipeline functions.

Split pipeline functions across files

appSync.pipelineFunctions also accepts a list of maps, which the Framework merges into one, so each map can come from its own file:

appSync:
  name: blog-api
  pipelineFunctions:
    - ${file(appsync/functions/users.yml)}
    - ${file(appsync/functions/posts.yml)}

Related pages

  • AppSync resolvers
  • AppSync data sources
  • Pipeline resolvers in AWS AppSync
Edit this page
Prev ResolversNextSubstitutions

Contents

  • AppSync pipeline functions
  • Pipeline function keys
  • Pipeline function runtimes
  • Inline data sources in pipeline functions
  • Split pipeline functions across files
  • Related pages

Related

GuidesPluginsExamplesSlack CommunitySupport