[{"data":1,"prerenderedAt":92},["ShallowReactive",2],{"pattern-apigw-lambda-durable-tenant-isolation-callback-nodejs-terraform":3,"pattern-group-apigw-lambda-durable-tenant-isolation-callback-nodejs-terraform":68},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":19,"extension":20,"framework":21,"gitHub":22,"highlight":6,"introBox":26,"language":31,"level":32,"meta":33,"patternArch":34,"patternGroup":54,"patternGroupLabel":6,"resources":55,"stem":63,"testing":64,"videoId":6,"__hash__":67},"patterns\u002Fpatterns\u002Fapigw-lambda-durable-tenant-isolation-callback-nodejs-terraform.json","Serverless multi-tenant workflow with external callback using AWS Lambda durable functions",null,{"text":8},[9,10],"terraform destroy","terraform show",[12],"content\u002Fcontributors\u002Fannangarachari-r.json",{"text":14},[15,16,17,18],"cd src\u002Fworkflow && npm install && cd ..\u002F..","cd src\u002Fcallback && npm install && cd ..\u002F..","terraform init","terraform apply","A multi-tenant workflow API that pauses while it waits for an external callback and then resumes, with per-tenant compute isolation keeping workflow state private.","json","Terraform",{"template":23},{"patternPath":24,"templateFile":25},"apigw-lambda-durable-tenant-isolation-callback\u002Fnodejs\u002Fterraform","main.tf",{"headline":27,"text":28},"How it works",[29,30],"SaaS applications often process tenant requests that cannot complete in a single invocation — the workflow must pause and wait for an external system to confirm before proceeding. During this wait, tenant-specific data from the first processing step (cached configuration, validated credentials, computed results) remains in the execution environment's memory. This pattern uses Lambda durable functions to suspend and resume the workflow across the wait boundary without losing progress, and Lambda tenant isolation mode to guarantee that the suspended environment — including all cached in-memory state — is never reassigned to a different tenant during the wait period.","The \u002Fworkflow endpoint starts a durable workflow for a specific tenant. The function checkpoints after its first step and suspends at zero compute cost, logging a callback token. When the external system confirms the operation, it sends the token to the \u002Fcallback endpoint, which resumes the workflow from its checkpoint. The resumed function skips all previously completed work and finishes processing with the confirmation payload. Multiple tenants can have workflows suspended simultaneously, each in a dedicated execution environment, each resuming independently when its callback arrives.","Node.js","300",{},{"icon1":35,"icon2":40,"icon3":45,"line1":47,"line2":51},{"x":36,"y":37,"service":38,"label":39},20,50,"apigw","Amazon API Gateway ",{"x":41,"y":42,"service":43,"label":44},75,25,"lambda-event-functions","AWS Lambda workflow function",{"x":41,"y":41,"service":43,"label":46},"AWS Lambda callback function",{"from":48,"to":49,"label":50},"icon1","icon2","Start Workflow",{"from":48,"to":52,"label":53},"icon3","Resume Workflow","apigw-lambda-durable-tenant-isolation-callback",{"bullets":56},[57,60],{"text":58,"link":59},"Lambda Durable Functions","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fdurable-functions.html",{"text":61,"link":62},"Lambda Tenant Isolation","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Ftenant-isolation.html","patterns\u002Fapigw-lambda-durable-tenant-isolation-callback-nodejs-terraform",{"text":65},[66],"See the GitHub repo for detailed testing instructions.","pQuHPE1r92ow7jyhzdM0dn4yvg9jJlQzxn4V5qVO8P4",[69],{"id":4,"title":5,"architectureURL":6,"cleanup":70,"contributors":72,"deploy":73,"description":19,"extension":20,"framework":21,"gitHub":75,"highlight":6,"introBox":77,"language":31,"level":32,"meta":79,"patternArch":80,"patternGroup":54,"patternGroupLabel":6,"resources":86,"stem":63,"testing":90,"videoId":6,"__hash__":67},{"text":71},[9,10],[12],{"text":74},[15,16,17,18],{"template":76},{"patternPath":24,"templateFile":25},{"headline":27,"text":78},[29,30],{},{"icon1":81,"icon2":82,"icon3":83,"line1":84,"line2":85},{"x":36,"y":37,"service":38,"label":39},{"x":41,"y":42,"service":43,"label":44},{"x":41,"y":41,"service":43,"label":46},{"from":48,"to":49,"label":50},{"from":48,"to":52,"label":53},{"bullets":87},[88,89],{"text":58,"link":59},{"text":61,"link":62},{"text":91},[66],1792492479507]