FlowsBook a callSign inCreate free accountSign up
Business and places data

A business data API or a scheduled workflow: which one your team should build

When calling a business data API from your own code is the right choice, when a scheduled no-code flow does the job with less to maintain, and how to have both.

Part of the guide Location intelligence automation

By the xMap team · · 5 min read

A business data API is the right choice when your own software needs places on demand, at the moment a user asks, inside a product you already run. A scheduled workflow is the better choice when the job is a recurring list or alert for people: new openings every morning, closures among your customers, a weekly count by district. Many teams reach for an API because it sounds more serious, then spend months rebuilding scheduling, memory of what was already sent, retries and email that a workflow tool already has.

This article is for the developer, the analyst and the manager who have to decide between the two. It sets out the questions that decide it, what you would have to build around an API yourself, and how xMap Flows lets you start with a flow and call it from code later without starting again.

Four questions that decide it

  • Who asks? If the trigger is a customer clicking in your app, you need an API call. If the trigger is a calendar, you need a schedule.
  • Who reads the answer? If it goes into your database or your screens, an API suits. If a person reads it in an inbox, a chat or a sheet, a flow delivers it with no code.
  • Does it need memory? "Only what is new since yesterday" means storing what was seen and comparing every run. That is a feature in a workflow tool and a project in your own code.
  • How often will the question change? If sales wants a different city or type every few weeks, a flow someone can edit beats a ticket to engineering.

What you build yourself around a raw API

Calling an endpoint is the easy part. A dependable job around it also needs a scheduler that copes with time zones, paging through large answers, retries when the service is busy, a store of what was already found so you do not resend it, a way to stop paying for searches when a budget is reached, and delivery: email, chat or a sheet. Each piece is small; together they are a service someone has to own.

In a flow those pieces are blocks: Schedule for the timetable in your own time zone, Only new for the memory, retries and failure paths in each block's settings, a monthly budget on each flow, and sending blocks for the delivery. The data comes from blocks such as Nearby places, which reads xMap's places database, or Map business scan, which searches online maps live.

You do not have to choose once

The practical path is to build and test the job as a flow, then call it from code when your product needs it. xMap Flows has a REST API that runs a flow and answers with its results.

  1. Build the flow in the editor and test it until the results are right.
  2. Create an access key under Settings, API keys.
  3. Call POST /v1/flows/{id}/run from your system. A test run sends nothing; a real run uses live data, sends what the flow sends and remembers its results. The answer carries each block's result and up to 500 items that reached the end.
  4. Or offer the flow as an AI employee and call POST /v1/employees/{name}/run with its inputs, which answers with a summary, a count and up to 100 items.

The logic stays in one place, editable by people who are not developers, and your code holds a single call. The API reference lists every endpoint, and the same flows can be used by AI assistants through the MCP server.

A made-up example: a delivery start-up in Jakarta

This example is invented. A small delivery company in Jakarta wants two things. Its merchant app should show a restaurant owner the competitors within 1 km when they sign up, and its sales team wants a list of newly found restaurants in three districts every morning.

The first is an API job: the trigger is a sign-up, the reader is the app. The team builds a flow with Nearby places counting restaurants around a point held in a flow variable, tests it, offers it as an AI employee, and has the app call it at sign-up with the restaurant's position as its input. The second is a schedule job: a Schedule at 07:00 Jakarta time, Nearby places across the three districts, Only new, and a sheet. No developer touches it after the first afternoon, and when sales asks to add a fourth district, a sales manager edits the Area of interest herself.

Signs you chose wrong

  • Your scheduled script has a table called sent_items and a cron entry nobody remembers writing: that is a workflow, built by hand.
  • Your no-code flow is being run by hand every time a user clicks something in your app: that is an API call waiting to happen.
  • Two teams keep separate copies of the same search logic: put it in one flow and call it from both.

Both routes end in the same place, which is location intelligence automation that runs without anyone babysitting it. Start with whichever matches who asks and who reads, and keep the logic where it can be changed most easily.

Questions

Is there an API to run xMap Flows from my own code?

Yes. The REST API runs a flow with POST /v1/flows/{id}/run and answers with its status and results; access keys are created in Settings.

Can a flow write straight into my database?

Yes. Save to my database writes each result into a table of your PostgreSQL, BigQuery or Snowflake database, so your system reads it like any other table.

Do I need a developer to build the flow?

No. Flows are built in a visual editor or by asking xMap in plain words. A developer is only needed for the code that calls it, if any.

Can AI assistants use the same flows?

Yes. Flows can be offered as AI employees that assistants call through the MCP server, with the same permissions as the person who connects.

Templates that do this

Read next

More on business and places data · Every article · Templates

Put it to work

An AI employee in xMap Flows does this on live data, on its own timetable. Start from a template or describe it in plain words.