Platform – Flows
To access the Ximilar Computer Vision Platform, first register at Ximilar App to get your API token.
The Ximilar Flows service allows you to connect individual categorization, tagging, regression, detection, similarity models, and ready-to-use services into a single REST API endpoint. With Flows, you can build complex solutions by aggregating results from multiple models or setting up conditional dependencies and branches — essentially creating a powerful hierarchical machine learning system in just a few clicks.
You can easily build a flow using only Ximilar App. For beginners, we recommend our introductory guide and YouTube tutorial.
Once defined, the flow can be executed via the /v2/process
prediction endpoint.
For large-scale flows with many models, the service supports [asynchronous requests] (https://docs.ximilar.com/async-api), allowing you to handle more requests without waiting for each result.
Pricing of Flows
Creating a flow definition in the frontend (at app.ximilar.com) is free. When you call the flow processing endpoint (/v2/process) on an image, you are charged for every service used within the flow. For example, if your flow contains three recognition tasks and all of them are executed during processing of an image, you will be billed 3 API credits — one credit for each service called.
Flows – Use Cases
Ximilar Flows enables you to build sophisticated AI systems across various industries including fashion, e-commerce, healthcare, and real estate. Below are three practical examples demonstrating how to leverage Flows for different scenarios.
Unified API Endpoint for Multiple Models
Imagine you are building a real estate image analysis system that needs to perform multiple classifications simultaneously. The system needs to:
- Classify room types (Bedroom, Kitchen, Bathroom, Living Room)
- Identify home features (Wooden Floor, Fireplace, TV, etc.)
- Assess property condition (Good, Average, Poor)
Instead of making three separate API calls (for our Image classification system), you can create a single Flow that processes all these tasks in parallel. This not only simplifies your integration but also improves performance by reducing network overhead.
Hierarchical Classification System
For a fashion classification system, you can create a hierarchical flow that:
- First identifies the main garment type (Pants vs. Shirt)
Then branches into specific attributes based on the detected garment type:
- Pants: Length (long, 3/4, short) and Material (Denim, etc.)
- Shirts: Sleeve Length, Color, and Neckline Type
This is achieved by creating individual recognition tasks for each attribute and connecting them in a Flow using a branch selector. The branch selector intelligently routes the image through the appropriate classification path based on the initial garment type detection.
Object Detection With Recognition
For traffic monitoring systems, you can create a comprehensive vehicle analysis pipeline that:
- Detects and classifies vehicles (Cars, Trucks, Motorcycles) on images
Performs vehicle-specific analysis:
- Cars: Color and Brand/Type identification
- Trucks: Size classification (Small, Medium, Large)
This is implemented using an Object Selector action with a "Vehicle Detector" task, followed by conditional recognition tasks that are triggered based on the detected vehicle type.
Flow Action Types
Every flow consists of one or several actions (or another nested flows):
- Branch Selector Action: This action contains an image recognition task and routes the flow based on its results (assigned labels). By default, it continues to the branch corresponding to the most probable label. Alternatively, you can enable a mode where all branches with label probabilities above a user-defined threshold are processed.
Deleting a task from the branch selector will make your flow invalid and stop the processing endpoint from working.
Each branch selector must include a task to determine which path to follow.
-
List Action: Executes a list of actions either in parallel (default) or in sequence, based on configuration.
-
Recognition Action: Executes an image recognition task and stores the output in a user-defined field.
-
Detection Action: Runs an object detection task to predict objects (bounding boxes), and stores the results in a specified field.
-
Object Selector Action: Runs an object detection task, crops each detected object from the image, and sends them for further analysis in the next actions. You can filter which objects to analyze based on probability or area thresholds.
-
Nested flow: Calls and executes another predefined flow.
-
Ximilar Service: Calls ready-to-use image recognition tools such as dominant colors, image upscaling, or background removal.
Call Flow
This is the main prediction endpoint for executing a flow on your records.
Similar to recognition/v2/classify
endpoint, it processes records
containing either _base64
or _url
fields for image input.
Required attributes
- Name
records
- Type
- array
- Description
An array of record objects. Each record must include either
_url
or_base64
field. Maximum of 10 records per request.
- Name
flow
- Type
- string
- Description
ID of the flow to be used for processing the records.
Returns
HTTP error code 2XX if the method was successful, and other HTTP error codes if the method failed. The response body contains the processed results according to your flow configuration.
Request
curl https://api.ximilar.com/flows/v2/process \
-H "Content-Type: application/json" \
-H "Authorization: Token __API_TOKEN__" \
-d '{
"records": [
{"_id": "__IMAGE_ID__", "_url": "__URL_IMAGE__" },
{"_id": "__IMAGE_ID__", "_base64": "__BASE64_DATA__"}
],
"flow": "__FLOW_ID__"
}'
Response
{
"status": {
"code": 200,
"message": "OK"
},
"records": [
{
"_id": "__IMAGE_ID__",
...
},
{
"_id": "__IMAGE_ID__",
...
}
]
}