{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Chained workflows","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"chained-workflows","__idx":0},"children":["Chained workflows"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some Spotnana APIs rely on a chained workflow where the response from one API call is used as part of the request body in subsequent API calls."," ","For example, the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/openapi/airapi#operation/airSearch"},"children":["get air itineraries"]}," API provides a unique ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["searchId"]}," as a"," ","result of a successful POST API call."," ","This unique ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["searchId"]}," is required as part of the request body in the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/openapi/airapi#operation/airAttributes"},"children":["get flight attributes"]}," API that"," ","must be called next."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/docs/assets/chained-workflows.e736ef1547bc91d4a0a158f49cf8d1f162801312a81eab18cf27708f4a0de5b4.9c1bb791.png","alt":"Chained Workflows"},"children":[]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"small","attributes":{},"children":[{"$$mdtype":"Tag","name":"center","attributes":{},"children":[{"$$mdtype":"Tag","name":"b","attributes":{},"children":["Fig:"]}," Visual representation of a chained workflow."]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sample-use-case","__idx":1},"children":["Sample Use Case"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Consider the following scenario that uses our Air APIs to illustrate a typical chained workflow:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You need to retrieve a selected itinerary and its corresponding information such as the"," ","leg details, number of travelers, ticket fare, ticket type, policy information and so on."," ","You could use the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/openapi/airapi#operation/airSelectedItinerary"},"children":["get selected itinerary"]}," API to retrieve this information."," ","However, that API requires a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["searchId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["itineraryId"]}," as mandatory parameters as part of the request body."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To retrieve the unique ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["searchId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["itineraryId"]},","," ","you’ll first need to run the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/openapi/airapi#operation/airSearch"},"children":["get air itineraries"]}," API and"," ","the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/openapi/airapi#operation/airAttributes"},"children":["get flight attributes"]}," API in sequential order."," ","These two APIs will return the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["searchId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["itineraryId"]}," along with other relevant information."," ","You can now copy and use these two parameters to run the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/openapi/airapi#operation/airSelectedItinerary"},"children":["get selected itinerary"]}," API."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/docs/assets/air-workflow.7fe194fc72efb8578562239026172ad9bbe8d149310de2db92207ed8140adac5.9c1bb791.png","alt":"Air Workflow"},"children":[]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"small","attributes":{},"children":[{"$$mdtype":"Tag","name":"center","attributes":{},"children":[{"$$mdtype":"Tag","name":"b","attributes":{},"children":["Fig:"]}," Chained workflow to run the Get Selected Itinerary API."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some of Spotnana's other APIs also use similar chained workflows."," ","You can find their relevant documentation under the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Workflows"]}," heading."]}]},"headings":[{"value":"Chained workflows","id":"chained-workflows","depth":1},{"value":"Sample Use Case","id":"sample-use-case","depth":2}],"frontmatter":{"seo":{"title":"Chained workflows"}},"lastModified":"2025-07-04T09:01:10.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/spotnana/chained_workflows","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}