Skip to main content
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.):
const payment = await processStripePayment();

// Add references at thread level
await thread.addRefs({
  stripe_payment_id: payment.id,
  stripe_customer_id: payment.customer,
  order_id: 'ORD-12345'
});

// Then record the step with context
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