Crossly Automation recipes
Latest: v1.0.0
Initial release
Write and validate a Crossly automation recipe
A recipe is one automation rule as a JSON document:
{
"$schema": "https://crossly.net/schemas/automation-recipe-v1.json",
"schemaVersion": 1,
"name": "Nudge stale listings down 5% after 30 days",
"description": "A small cut with a floor, so it keeps moving without you watching it.",
"trigger": { "type": "listing.age_reached", "config": { "ageDays": 30 } },
"condition": { "type": "listing.price_above", "config": { "threshold": 25 } },
"action": { "type": "listing.price_drop", "config": { "mode": "percent", "percent": 5, "floor": 12, "minDaysListed": 30 } }
}
Schema: https://crossly.net/schemas/automation-recipe-v1.json (JSON Schema draft 2020-12). Rules it enforces:
- Required:
schemaVersion(the constant1),name(1-200 characters),trigger,action. Optional:$schema,description,condition,platforms(a platform filter for the whole rule). additionalProperties: falseeverywhere: a misspelt key fails validation.trigger,conditionandactionare each{ "type": "<one of the listed types>", "config": { … } }, andconfigmust match that type's own keys exactly.
Setup
- Create a free Crossly account: https://crossly.net/register
- Create a personal access token at https://crossly.net/settings/api/tokens/new (guide: https://crossly.net/guides/personal-access-tokens). Use a
crossly_pat_test_token against the sandbox while building. - Export it as
CROSSLY_PATand send it asAuthorization: Bearer $CROSSLY_PATtohttps://crossly.net/api/v1/*. Full docs: https://crossly.net/docs
Pick the types from the schema, never guess
Read the schema's oneOf lists for the full set and each config. Examples by category:
- Triggers:
schedule.cron(cron,timezone),schedule.daily(hourUtc),schedule.interval(intervalMinutes),listing.created,listing.sold,listing.liked,listing.age_reached(ageDays),listing.no_views_after(ageDays,maxViews),inbox.offer_received,inbox.message_received,order.shipped,order.delivered,order.ship_by_soon,order.unshipped_after(daysOverdue),inventory.low_stock(threshold),inventory.zero_qty,market.competitor_underprice,platform.disconnected. - Conditions:
listing.platform(platforms),listing.price_range(minPrice,maxPrice),listing.price_above/listing.price_below(threshold),listing.age_range(minDays,maxDays),listing.has_tags(tags,matchAll),listing.has_label(label). - Actions:
listing.price_drop(mode,percent,fixedAmount,floor,minDaysListed),listing.reprice(strategy, …),listing.timed_discount,listing.share_closet,listing.send_offer_to_likers(discountPercent, …),listing.auto_relist,listing.delist,listing.expand_platforms(targetPlatforms),inbox.send_thank_you(template),inbox.offer_auto_respond,notify.slack/notify.discord/notify.webhook(integrationId,template),notify.email_user(subject,body),crm.push_buyer(integrationId),account.toggle_vacation(enabled).
Money in recipes follows the key names: the schema describes fixedAmount and threshold as USD amounts and floor as an absolute price (dollars, like listing prices), while …Cents keys (floorCents, undercutByCents, ceilingCents) are integer cents. Every repeating discount needs a floor, or it walks a price to nothing over a long listing life.
Ids the schema can't know (a Slack integrationId, a cannedId) must be the seller's real ids. Use an obviously invalid placeholder like REPLACE_WITH_SLACK_INTEGRATION_ID in shared recipes so an unedited import fails loudly.
Validate in two steps
- Offline against the schema: any draft 2020-12 validator (for example Ajv's
Ajv2020), the recipe validator at https://crossly-dev.github.io/crossly-playground/, or the Crossly VS Code extension (files named*.crossly-recipe.json). - Online against the server's catalog (
automation:read):POST /v1/automation/rules/validate-recipewith the recipe, or a bundle{ "schemaVersion": 1, "recipes": [ … ] }. It answers{ valid, count, results: [{ name, valid, errors }] }, checking each type id and running the server's own config validators. It does not look up the seller's data, so a wrongintegrationIdpasses here and fails when the rule runs.GET /v1/automation/cataloglists the supportedtriggerType/actionType/conditionTypevalues with eachconfigSchema.
const { valid, results } = await crossly.automation.validateRecipe(recipe) as { valid: boolean; results: unknown[] };
Import
POST /v1/automation/rules/import (automation:write) takes one recipe or a bundle. Imported rules arrive paused; ?activate=true turns them on at once, which you should only do after the seller has read the numbers. A partial import is a success: read both the created rules and the errors in the response.
await crossly.automation.importRecipes(recipe, { activate: false, idempotencyKey: crypto.randomUUID() });
- CLI:
crossly automation import-recipes --payload "$(cat my.crossly-recipe.json)" - MCP:
validate_automation_recipe, thenimport_automation_recipes(activatedefaults to false);get_automation_catalogfirst. - Export existing rules:
GET /v1/automation/rules/{id}/export,GET /v1/automation/rules/export(automation:read).
Deprecation: recipes become workflows
Every /v1/automation/rules endpoint (list, CRUD, toggle, run-now, export, import and validate-recipe) and GET /v1/automation/runs is deprecated since 2026-11-27 and keeps working until 2027-03-01 (the Sunset date). Responses carry Deprecation, Sunset and Link: </api/v1/workflows>; rel="successor-version" headers. GET /v1/automation/catalog is not deprecated.
The facade already stores each rule as a workflow: an imported recipe appears in GET /v1/workflows?legacyRef=rule:<ruleId> and its runs in GET /v1/workflow-runs. For anything new, and for anything that must outlive the sunset, build a crossly.workflow document instead (a graph of nodes, not one trigger/condition/action; a different format from recipes). See the crossly-workflows skill.
Ready-made recipes
44 validated recipes (pricing ladders, offers, fulfilment reminders, notifications) live at https://github.com/crossly-dev/crossly-recipes. Start from the closest one and change the numbers to the seller's own floors.
