Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.threadify.dev/llms.txt

Use this file to discover all available pages before exploring further.

References link threads to external system identifiers like order IDs, customer IDs, or support tickets. They enable you to query threads using identifiers from your existing systems.

Reference Types

TypeExample Use Case
Order IDsE-commerce order numbers
Custom IDsAny business-relevant identifier

Reference Properties

PropertyDescription
KeyThe reference type (e.g., “order_id”)
ValueThe actual identifier (e.g., “ORD-789”)
Thread associationLinks to a specific thread
QueryableCan be used to find threads

Adding References

Link workflows to external systems (Stripe, Shopify, etc.):
// Add references to an existing thread
await thread.addRefs({
  stripe_payment_id: payment.id,
  stripe_customer_id: payment.customer,
  order_id: 'ORD-12345'
});

await thread.step('process_payment')
  .addContext({ amount: 299.99, currency: 'USD' })
  .success();

Querying by Reference

const threads = await threadify.getThreadsByRef({
  refKey: 'stripe_payment_id',
  refValue: 'pi_1234567890'
});

Next Steps

Sub-steps

Break down complex operations

Getting Threads

Query workflow data