curl --request GET \
--url https://api-dev.narrative.io/workflows/{workflow_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/workflows/{workflow_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/workflows/{workflow_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/workflows/{workflow_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/workflows/{workflow_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/workflows/{workflow_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/workflows/{workflow_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "my-etl-workflow",
"specification": "document:\n dsl: '1.0.0'\n namespace: test\n name: test-workflow\n version: '1.0.0'\ndo:\n - createView:\n call: CreateMaterializedViewIfNotExists\n with:\n nql: \"CREATE MATERIALIZED VIEW workflow_output AS SELECT track_id FROM company_data.workflow_input\"\n - refreshView:\n call: RefreshMaterializedView\n with:\n datasetName: workflow_output\n - insertData:\n call: ExecuteDml\n with:\n nql: \"INSERT INTO company_data.workflow_input (track_id) VALUES ('test')\"\n",
"data_plane_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"company_id": 100,
"created_at": "2025-01-15T10:30:00Z",
"created_by": 20,
"updated_at": "2025-01-15T10:30:00Z",
"status": "active",
"tags": [
"<string>"
],
"archived_at": null
}{
"type": null,
"title": "Failed to Parse Query",
"status": 400,
"detail": "Invalid query format.",
"instance": "/nql/validate",
"log_id": "c06fea02-0950-45c6-aaff-07ab07c0d04c",
"debug": null
}Get a workflow
Retrieve a workflow by its ID. Only workflows owned by the authenticated company are accessible.
curl --request GET \
--url https://api-dev.narrative.io/workflows/{workflow_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/workflows/{workflow_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/workflows/{workflow_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/workflows/{workflow_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/workflows/{workflow_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/workflows/{workflow_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/workflows/{workflow_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "my-etl-workflow",
"specification": "document:\n dsl: '1.0.0'\n namespace: test\n name: test-workflow\n version: '1.0.0'\ndo:\n - createView:\n call: CreateMaterializedViewIfNotExists\n with:\n nql: \"CREATE MATERIALIZED VIEW workflow_output AS SELECT track_id FROM company_data.workflow_input\"\n - refreshView:\n call: RefreshMaterializedView\n with:\n datasetName: workflow_output\n - insertData:\n call: ExecuteDml\n with:\n nql: \"INSERT INTO company_data.workflow_input (track_id) VALUES ('test')\"\n",
"data_plane_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"company_id": 100,
"created_at": "2025-01-15T10:30:00Z",
"created_by": 20,
"updated_at": "2025-01-15T10:30:00Z",
"status": "active",
"tags": [
"<string>"
],
"archived_at": null
}{
"type": null,
"title": "Failed to Parse Query",
"status": 400,
"detail": "Invalid query format.",
"instance": "/nql/validate",
"log_id": "c06fea02-0950-45c6-aaff-07ab07c0d04c",
"debug": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a workflow.
Response
The workflow.
Unique identifier for a workflow.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
The name of the workflow, extracted from the specification.
"my-etl-workflow"
The workflow specification in YAML format.
"document:\n dsl: '1.0.0'\n namespace: test\n name: test-workflow\n version: '1.0.0'\ndo:\n - createView:\n call: CreateMaterializedViewIfNotExists\n with:\n nql: \"CREATE MATERIALIZED VIEW workflow_output AS SELECT track_id FROM company_data.workflow_input\"\n - refreshView:\n call: RefreshMaterializedView\n with:\n datasetName: workflow_output\n - insertData:\n call: ExecuteDml\n with:\n nql: \"INSERT INTO company_data.workflow_input (track_id) VALUES ('test')\"\n"
The data plane this workflow is associated with.
"d1e2f3a4-b5c6-7890-abcd-ef1234567890"
The company that owns this workflow.
100
ISO-8601 timestamp of when the workflow was created.
"2025-01-15T10:30:00Z"
The ID of the user who created this workflow.
20
ISO-8601 timestamp of when the workflow was last updated.
"2025-01-15T10:30:00Z"
The current status of the workflow.
active, archived "active"
Tags that describe the workflow.
1 - 128ISO-8601 timestamp of when the workflow was archived, or null if active.
null
Was this page helpful?

