arazzo: 1.0.1 info: title: Affinda Create Search Index and Add a Document summary: Create a Search & Match index, add a document to it, then list the index's documents. description: >- Builds a searchable index for the Search & Match product. A new index is created for a document type, an existing parsed document is added to it, and the index's documents are listed to confirm the document was indexed. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: affindaV3Api url: ../openapi/affinda-v3-openapi.yml type: openapi workflows: - workflowId: create-index-and-add-document summary: Create an index, add a document, then list the index's documents. description: >- Creates a named index, indexes the supplied document into it, and lists the index documents to confirm. inputs: type: object required: - name - document properties: name: type: string description: The unique name for the new index. docType: type: string description: The document type for the index (e.g. resumes or job_descriptions). document: type: string description: The identifier of the parsed document to add to the index. steps: - stepId: createIndex description: Create a new Search & Match index. operationId: createIndex requestBody: contentType: application/json payload: name: $inputs.name docType: $inputs.docType successCriteria: - condition: $statusCode == 201 outputs: indexName: $response.body#/name - stepId: addDocument description: Index the supplied document into the new index. operationId: createIndexDocument parameters: - name: name in: path value: $steps.createIndex.outputs.indexName requestBody: contentType: application/json payload: document: $inputs.document successCriteria: - condition: $statusCode == 201 outputs: document: $response.body#/document - stepId: listIndexDocuments description: List the documents in the index to confirm the document was added. operationId: getAllIndexDocuments parameters: - name: name in: path value: $steps.createIndex.outputs.indexName successCriteria: - condition: $statusCode == 200 outputs: count: $response.body#/count outputs: indexName: $steps.createIndex.outputs.indexName indexedDocument: $steps.addDocument.outputs.document count: $steps.listIndexDocuments.outputs.count