New to Kestra?
Use blueprints to kickstart your first workflows.
Search your HubSpot CRM with Kestra to pull the 10 most recently created companies, returning name, domain, and industry properties for downstream pipelines.
id: hubspot-query-company
namespace: company.team
tasks:
- id: search_companies
type: io.kestra.plugin.hubspot.companies.Search
apiKey: "{{ secret('HUBSPOT_API_KEY') }}"
properties:
- name
- domain
- industry
limit: 10
sorts:
- propertyName: "createdate"
direction: "DESCENDING"
Pulling fresh company records out of your HubSpot CRM usually means glue code, manual API calls, or brittle scripts that nobody maintains. This blueprint turns that into a single declarative Kestra flow that searches HubSpot companies, sorts them by creation date, and returns the latest 10 with exactly the CRM properties you care about (name, domain, industry). It gives revenue, marketing, and data teams a repeatable, auditable way to surface new accounts and feed them into reporting, enrichment, or downstream automation.
The flow runs a single task, search_companies, of type io.kestra.plugin.hubspot.companies.Search. It authenticates to the HubSpot CRM API using an apiKey resolved from {{ secret('HUBSPOT_API_KEY') }}, so no credentials live in the flow definition. The task requests the name, domain, and industry properties, applies a limit of 10, and sorts results by createdate in DESCENDING order so the newest companies come back first. The output is the matching set of company records, ready to pass to later tasks.
name, domain, and industry.HubSpot workflows can react inside HubSpot, but they cannot orchestrate the steps that come before and after a query across your wider stack. With Kestra you can attach event or schedule triggers, add automatic retries when the CRM API rate limits or times out, chain the company records into enrichment, warehouse loads, and alerts, and keep full execution lineage for every run. Everything is declarative YAML you can version, review, and reuse, filling the gap HubSpot's own automation leaves between the CRM and the rest of your data platform.
HUBSPOT_API_KEY: your HubSpot API key (or private app token) used to authenticate the company search.HUBSPOT_API_KEY secret to your Kestra instance.properties, limit, or sorts to match your reporting needs.limit or page through results to capture more companies.lifecyclestage, city, or numberofemployees.