SWIRLS_
ReferenceSDKClient

Streams

SDK reference for streams — Persist graph execution output to structured data tables and query the results.

Persist graph execution output to structured data tables and query the results.

createStream

Create a new stream that persists data from graph executions over time. The persistenceCondition is a JavaScript expression evaluated after each execution to decide whether to store the result (e.g., "true" to always persist, or "output.status === 'success'").

POST

Usage:

const result = await swirls.client.streams.createStream({
  projectId: '...',
  graphId: '...',
  name: '...',
  persistenceCondition: '...',
})

Input:

ParameterTypeRequiredDescription
idstringNo
projectIdstringYes
graphIdstringYes
namestringYes
descriptionstringNo
persistenceConditionstringYes
enabledbooleanNo

Output:

FieldTypeDescription
idstring

getStream

Get a stream by ID

GET

Usage:

const result = await swirls.client.streams.getStream({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
projectIdstring
graphIdstring
namestring
descriptionstring | null
persistenceConditionstring
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring
graphobject

updateStream

Update a stream

PUT

Usage:

const result = await swirls.client.streams.updateStream({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes
namestringNo
descriptionstringNo
persistenceConditionstringNo
enabledbooleanNo

Output:

FieldTypeDescription
idstring
projectIdstring
graphIdstring
namestring
descriptionstring | null
persistenceConditionstring
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

deleteStream

Delete a stream

DELETE

Usage:

const result = await swirls.client.streams.deleteStream({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

listStreams

List all streams in a project

GET

Usage:

const result = await swirls.client.streams.listStreams({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

listStreamSchemas

GET

Usage:

const result = await swirls.client.streams.listStreamSchemas({
  streamId: '...',
})

Input:

ParameterTypeRequiredDescription
streamIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

promoteStreamSchema

POST

Usage:

const result = await swirls.client.streams.promoteStreamSchema({
  streamId: '...',
  schemaVersion: 1,
  includedColumns: [],
})

Input:

ParameterTypeRequiredDescription
streamIdstringYes
schemaVersionnumberYes
includedColumnsstring[]Yes

Output:

FieldTypeDescription
idstring
streamIdstring
versionnumber
schemaobject
tableNamestring | null
draftboolean
includedColumnsstring[] | null
createdAtunknown
orgIdstring | null
userIdstring

listStreamTableColumns

GET

Usage:

const result = await swirls.client.streams.listStreamTableColumns({
  projectId: '...',
  streamId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
streamIdstringYes

getStreamTableSchema

GET

Usage:

const result = await swirls.client.streams.getStreamTableSchema({
  projectId: '...',
  streamId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
streamIdstringYes

executeStreamQuery

Query data from a stream using filters. To discover available columns, first call get_stream_table_schema or list_stream_table_columns for the stream.

POST

Usage:

const result = await swirls.client.streams.executeStreamQuery({
  projectId: '...',
  streamId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
streamIdstringYes
filtersobject[]No
limitnumberNo
offsetnumberNo

Output:

FieldTypeDescription
columnsstring[]
rowsunknown[][]

On this page