Fetching Logs Programmatically
You can fetch logs for your instances, connections, data sources, and other Prismatic resources programmatically using the events) query.
An event currently represents a log entry, and may represent additional resources (such as step results) in the future.
To filter for log entries specifically, pass typeIn: [LOG_EVENT] to the query.
Querying logs
Use the events query with typeIn: [LOG_EVENT] to fetch log entries.
Because Event is a union type, use an inline fragment (... on LogEvent) to select log-specific fields:
query FetchLogs($timestampGte: DateTime!, $timestampLte: DateTime!) {
events(
typeIn: [LOG_EVENT]
orderBy: { field: TIMESTAMP, direction: DESC }
timestampGte: $timestampGte
timestampLte: $timestampLte
) {
nodes {
id
timestamp
... on LogEvent {
logType
message
flowName
severity
instanceId
instanceName
customerName
integrationName
instanceType
executionResultId
requiredConfigVariableKey
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
{
"timestampGte": "2026-04-22T00:15:30.726000+00:00",
"timestampLte": "2026-04-22T16:15:28.510000+00:00"
}
If you omit either timestampGte or timestampLte, the query is time-boxed to a two-hour range by default.
If you specify neither argument, the query returns logs from the past two hours.
To query a longer window, supply both timestamps explicitly.
LogEvent fields
The fields available on a LogEvent node include:
| Field | Description |
|---|---|
id | The unique identifier for the event. |
timestamp | The time the log entry was recorded. |
logType | The source of the log: EXECUTION, CONNECTION, DATA_SOURCE, MANAGEMENT, or RATE_LIMIT. |
message | The log message text. |
severity | The log level: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, or METRIC. |
flowName | The name of the flow that produced the log (when applicable). |
instanceId | The ID of the instance that produced the log. |
instanceName | The name of the instance that produced the log. |
instanceType | INTEGRATION for a standard instance, or WORKFLOW for an embedded customer workflow. |
customerName | The name of the customer associated with the instance. |
integrationName | The name of the integration associated with the instance. |
executionResultId | The ID of the execution result this log was produced during, when applicable. |
requiredConfigVariableKey | The key of the config variable this log is associated with, for connection and data source logs. |
Filtering logs
Narrow your results by combining the events query arguments:
- By time range - pass both
timestampGteandtimestampLteas ISO 8601 timestamps to query a specific window. - By log type and severity - use
filterGroupsto filter onlogType(for example,EXECUTIONvs.CONNECTION) orseverity(for example,ERRORvs.INFO). - By flow, instance, customer, or integration - use
filterGroupsto filter on fields likeinstanceIdorflowName.
Paginating through results
Like other Prismatic queries, the events query returns up to 100 nodes per page.
If pageInfo.hasNextPage is true, use the pageInfo.endCursor value as the after argument on your next request to fetch the next page.
For more information, see Pagination.
Fetching logs with Node.js
The example below fetches all log events in a time window, paging through results until every page has been processed. It prints each log entry to the console.
const PRISMATIC_URL =
process.env.PRISMATIC_URL || "https://app.prismatic.io/api";
const PRISMATIC_API_KEY = process.env.PRISMATIC_API_KEY;
const query = `query FetchLogs($timestampGte: DateTime!, $timestampLte: DateTime!, $after: String) {
events(
typeIn: [LOG_EVENT]
orderBy: { field: TIMESTAMP, direction: DESC }
timestampGte: $timestampGte
timestampLte: $timestampLte
after: $after
) {
nodes {
id
timestamp
... on LogEvent {
logType
message
flowName
severity
instanceName
customerName
integrationName
executionResultId
}
}
pageInfo {
hasNextPage
endCursor
}
}
}`;
async function fetchLogs(timestampGte, timestampLte) {
let after = null;
const logs = [];
do {
const response = await fetch(PRISMATIC_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${PRISMATIC_API_KEY}`,
},
body: JSON.stringify({
query,
variables: { timestampGte, timestampLte, after },
}),
});
const { data, errors } = await response.json();
if (errors) {
throw new Error(JSON.stringify(errors));
}
logs.push(...data.events.nodes);
after = data.events.pageInfo.hasNextPage
? data.events.pageInfo.endCursor
: null;
} while (after);
return logs;
}
async function main() {
const logs = await fetchLogs(
"2026-04-22T00:00:00+00:00",
"2026-04-22T23:59:59+00:00",
);
for (const log of logs) {
console.log(
`[${log.timestamp}] ${log.severity} ${log.logType} - ${log.message}`,
);
}
}
main();