360 Secure SkillHub
360 安全技能中心

Crossly Automation recipes

按 Crossly 的 automation-recipe-v1 schema 起草单步自动化规则 JSON,先离线校验再提交服务端校验,最后以暂停状态导入;也可导出已有规则,并提示 rules 接口将于 2027-03-01 由 workflows 取代。

分类:自动化
crossly
热度 9.17
最近更新 2026-11-30 11:07:23

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-automation-recipes
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-automation-recipes
description
Write, validate and import a Crossly automation recipe, the portable JSON format for one automation rule (schemaVersion 1, trigger, optional condition, action) described by https://crossly.net/schemas/automation-recipe-v1.json. Pick trigger/condition/action types from the published schema, validate offline against it and online with POST /v1/automation/rules/validate-recipe, then import paused with POST /v1/automation/rules/import. The rules endpoints are deprecated (sunset 2027-03-01) in favour of workflows. Use when creating price-drop ladders, offer rules, ship-by reminders, notifications or other single-step Crossly automations as JSON.

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 constant 1), name (1-200 characters), trigger, action. Optional: $schema, description, condition, platforms (a platform filter for the whole rule).
  • additionalProperties: false everywhere: a misspelt key fails validation.
  • trigger, condition and action are each { "type": "<one of the listed types>", "config": { … } }, and config must match that type's own keys exactly.

Setup

  1. Create a free Crossly account: https://crossly.net/register
  2. 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.
  3. Export it as CROSSLY_PAT and send it as Authorization: Bearer $CROSSLY_PAT to https://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

  1. 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).
  2. Online against the server's catalog (automation:read): POST /v1/automation/rules/validate-recipe with 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 wrong integrationId passes here and fails when the rule runs. GET /v1/automation/catalog lists the supported triggerType / actionType / conditionType values with each configSchema.
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, then import_automation_recipes (activate defaults to false); get_automation_catalog first.
  • 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.