Create API Workflow for exported Tool
Now that you've exported a Credit Card Statement Parser Tool, let's create a Workflow that we'll launch as an API. First off, let's create a new empty Workflow:
- From the side navigation menu, choose
Workflows
🞂New Workflow
. This should bring up the new Workflow dialog:
- For
Workflow Name
enterCredit Card Statement Parser API
- For
Description
enterWorkflow to create credit card statement parser API
- Click on
Create Workflow
. This should land you in an empty workflow in the Workflow Studio, which allows you to build sophisticated workflows.
Let's look at the layout of the Workflow Studio.
Legend:
- Input Configuration: You can configure what kind of input you want. We've chosen
API
here since we want to deploy our exported credit card statement parser tool as an API. If you want to build an ETL Pipeline however, you can chooseFile System
from this list. - Output Configuration: You configure your workflow's output here. Since we're deploying an API with this workflow, we're setting it to
API
. Unstract can also output to databases or data warehouses in case you're deploying an unstructured data ETL Pipeline. - Workflow Chain: In the workflow shown above, the exported Credit Cards Statements Parser Prompt Studio project has been dragged and dropped from the list of available Tools from the
Tools
pane on the right side. You can compose sophisticated workflows by chaining various available Tools. But now since we only need a simple workflow, we have just one Tool in the chain. - Input/Output Viewer: this is where you can see the input and output from various steps in Workflow Studio's Single Stepping Mode. This feature is very helpful in developing and debugging sophisticated workflows. We will not be using this feature for our current project.
- Tools Pane: this pane lists all built in and user created custom Tools available in the platform. Prompt Studio projects you export are made available as Tools in this pane from where you an drop and drop them into the Workflow Chain to construct Workflows you want.
- Tool Settings Pane: This is where settings for various tools are made available. You'll need to select a Tool from the Workflow Chain in order to change the settings of Tools from here.
- Deploy As API: use this button to deploy a workflow as an API.
- Deploy As ETL Pipeline: use this button to deploy workflows as unstructured data ETL Pipelines.
Now, continuing with our quick start project, click on the Deploy As API
button and you should see a dialog pop up:
- For
Display Name
enterCredit Card Statements API
- For
Description
enterAPI that can parser US credit card statements
- For
API Name
entercredit_card_statements_parser
. This will be part of the API endpoint name and let you meaningfully identify it.
That's pretty much it! We've deployed our workflow as a new API. In the next section, let's see how to get API endpoint and API key with which, we can make an API call with a test credit card statement to see how it performs.
Fetching API Details​
Now that our workflow is deployed as an API, let's get the endpoint and API key so that we can make calls to it to structure credit card statements.
Legend:
- Copy API Endpoint: copies API endpoint to the clipboard.
- API Action Menu: displays action menu
Choose API Action Menu
🞂 Download Postman Collection
to download the Postman Collection for this API endpoint we just created.
Now that we have the Postman Collection, in the next section, let's use Postman to make the API call with our test credit card statement.