Python
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
response = client.applications.process(
edges=[{
"from_field": "from_field",
"from_node": "from_node",
"to_field": "to_field",
"to_node": "to_node",
}],
inputs={
"foo": {
"foo": "bar"
}
},
nodes=[{
"id": "id",
"application_node_schema_id": "text_input_schema",
}],
version="V0",
)
print(response)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Applications.Process(context.TODO(), sgp.ApplicationProcessParams{
Edges: sgp.F([]sgp.ApplicationEdgeParam{{
FromField: sgp.F("from_field"),
FromNode: sgp.F("from_node"),
ToField: sgp.F("to_field"),
ToNode: sgp.F("to_node"),
}}),
Inputs: sgp.F(map[string]map[string]interface{}{
"foo": {
"foo": "bar",
},
}),
Nodes: sgp.F([]sgp.ApplicationNodeParam{{
ID: sgp.F("id"),
ApplicationNodeSchemaID: sgp.F(sgp.ApplicationNodeApplicationNodeSchemaIDTextInputSchema),
}}),
Version: sgp.F(sgp.ApplicationProcessParamsVersionV0),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}curl --request POST \
--url https://api.egp.scale.com/v4/applications/process \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {},
"nodes": [
{
"id": "<string>",
"configuration": {}
}
],
"edges": [
{
"from_node": "<string>",
"to_node": "<string>",
"from_field": "<string>",
"to_field": "<string>"
}
],
"version": "<string>",
"history": [],
"overrides": {
"concurrent": false,
"use_channels": false,
"partial_trace": [
{
"workflow_id": "<string>",
"node_id": "<string>",
"operation_type": "<string>",
"start_timestamp": "<string>",
"operation_input": "<string>",
"operation_output": "<string>",
"duration_ms": 123,
"operation_metadata": {}
}
],
"return_span": true
},
"stream": false,
"operation_metadata": {}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: {},
nodes: [{id: '<string>', configuration: {}}],
edges: [
{
from_node: '<string>',
to_node: '<string>',
from_field: '<string>',
to_field: '<string>'
}
],
version: '<string>',
history: [],
overrides: {
concurrent: false,
use_channels: false,
partial_trace: [
{
workflow_id: '<string>',
node_id: '<string>',
operation_type: '<string>',
start_timestamp: '<string>',
operation_input: '<string>',
operation_output: '<string>',
duration_ms: 123,
operation_metadata: {}
}
],
return_span: true
},
stream: false,
operation_metadata: {}
})
};
fetch('https://api.egp.scale.com/v4/applications/process', 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.egp.scale.com/v4/applications/process",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
],
'nodes' => [
[
'id' => '<string>',
'configuration' => [
]
]
],
'edges' => [
[
'from_node' => '<string>',
'to_node' => '<string>',
'from_field' => '<string>',
'to_field' => '<string>'
]
],
'version' => '<string>',
'history' => [
],
'overrides' => [
'concurrent' => false,
'use_channels' => false,
'partial_trace' => [
[
'workflow_id' => '<string>',
'node_id' => '<string>',
'operation_type' => '<string>',
'start_timestamp' => '<string>',
'operation_input' => '<string>',
'operation_output' => '<string>',
'duration_ms' => 123,
'operation_metadata' => [
]
]
],
'return_span' => true
],
'stream' => false,
'operation_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/applications/process")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {},\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"edges\": [\n {\n \"from_node\": \"<string>\",\n \"to_node\": \"<string>\",\n \"from_field\": \"<string>\",\n \"to_field\": \"<string>\"\n }\n ],\n \"version\": \"<string>\",\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/applications/process")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {},\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"edges\": [\n {\n \"from_node\": \"<string>\",\n \"to_node\": \"<string>\",\n \"from_field\": \"<string>\",\n \"to_field\": \"<string>\"\n }\n ],\n \"version\": \"<string>\",\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "<string>"
}
],
"sgp_error_code": "APPLICATION_BUILDER_VALIDATION_ERROR"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"message": "<string>",
"sgp_error_code": "APPLICATION_PROCESSING_ERROR",
"detail": "<string>"
}Applications
Process Application
POST
/
v4
/
applications
/
process
Python
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
response = client.applications.process(
edges=[{
"from_field": "from_field",
"from_node": "from_node",
"to_field": "to_field",
"to_node": "to_node",
}],
inputs={
"foo": {
"foo": "bar"
}
},
nodes=[{
"id": "id",
"application_node_schema_id": "text_input_schema",
}],
version="V0",
)
print(response)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Applications.Process(context.TODO(), sgp.ApplicationProcessParams{
Edges: sgp.F([]sgp.ApplicationEdgeParam{{
FromField: sgp.F("from_field"),
FromNode: sgp.F("from_node"),
ToField: sgp.F("to_field"),
ToNode: sgp.F("to_node"),
}}),
Inputs: sgp.F(map[string]map[string]interface{}{
"foo": {
"foo": "bar",
},
}),
Nodes: sgp.F([]sgp.ApplicationNodeParam{{
ID: sgp.F("id"),
ApplicationNodeSchemaID: sgp.F(sgp.ApplicationNodeApplicationNodeSchemaIDTextInputSchema),
}}),
Version: sgp.F(sgp.ApplicationProcessParamsVersionV0),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}curl --request POST \
--url https://api.egp.scale.com/v4/applications/process \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {},
"nodes": [
{
"id": "<string>",
"configuration": {}
}
],
"edges": [
{
"from_node": "<string>",
"to_node": "<string>",
"from_field": "<string>",
"to_field": "<string>"
}
],
"version": "<string>",
"history": [],
"overrides": {
"concurrent": false,
"use_channels": false,
"partial_trace": [
{
"workflow_id": "<string>",
"node_id": "<string>",
"operation_type": "<string>",
"start_timestamp": "<string>",
"operation_input": "<string>",
"operation_output": "<string>",
"duration_ms": 123,
"operation_metadata": {}
}
],
"return_span": true
},
"stream": false,
"operation_metadata": {}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: {},
nodes: [{id: '<string>', configuration: {}}],
edges: [
{
from_node: '<string>',
to_node: '<string>',
from_field: '<string>',
to_field: '<string>'
}
],
version: '<string>',
history: [],
overrides: {
concurrent: false,
use_channels: false,
partial_trace: [
{
workflow_id: '<string>',
node_id: '<string>',
operation_type: '<string>',
start_timestamp: '<string>',
operation_input: '<string>',
operation_output: '<string>',
duration_ms: 123,
operation_metadata: {}
}
],
return_span: true
},
stream: false,
operation_metadata: {}
})
};
fetch('https://api.egp.scale.com/v4/applications/process', 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.egp.scale.com/v4/applications/process",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
],
'nodes' => [
[
'id' => '<string>',
'configuration' => [
]
]
],
'edges' => [
[
'from_node' => '<string>',
'to_node' => '<string>',
'from_field' => '<string>',
'to_field' => '<string>'
]
],
'version' => '<string>',
'history' => [
],
'overrides' => [
'concurrent' => false,
'use_channels' => false,
'partial_trace' => [
[
'workflow_id' => '<string>',
'node_id' => '<string>',
'operation_type' => '<string>',
'start_timestamp' => '<string>',
'operation_input' => '<string>',
'operation_output' => '<string>',
'duration_ms' => 123,
'operation_metadata' => [
]
]
],
'return_span' => true
],
'stream' => false,
'operation_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/applications/process")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {},\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"edges\": [\n {\n \"from_node\": \"<string>\",\n \"to_node\": \"<string>\",\n \"from_field\": \"<string>\",\n \"to_field\": \"<string>\"\n }\n ],\n \"version\": \"<string>\",\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/applications/process")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {},\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"configuration\": {}\n }\n ],\n \"edges\": [\n {\n \"from_node\": \"<string>\",\n \"to_node\": \"<string>\",\n \"from_field\": \"<string>\",\n \"to_field\": \"<string>\"\n }\n ],\n \"version\": \"<string>\",\n \"history\": [],\n \"overrides\": {\n \"concurrent\": false,\n \"use_channels\": false,\n \"partial_trace\": [\n {\n \"workflow_id\": \"<string>\",\n \"node_id\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"operation_input\": \"<string>\",\n \"operation_output\": \"<string>\",\n \"duration_ms\": 123,\n \"operation_metadata\": {}\n }\n ],\n \"return_span\": true\n },\n \"stream\": false,\n \"operation_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "<string>"
}
],
"sgp_error_code": "APPLICATION_BUILDER_VALIDATION_ERROR"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"message": "<string>",
"sgp_error_code": "APPLICATION_PROCESSING_ERROR",
"detail": "<string>"
}Body
application/json
Input data for the application. You must provide inputs for each input node
Show child attributes
Show child attributes
List of nodes in the application graph
Show child attributes
Show child attributes
List of edges in the application graph
Show child attributes
Show child attributes
Version of the application schema
Allowed value:
"V0"History of the application
Show child attributes
Show child attributes
Execution override options for agentic applications
- AgenticApplicationOverrides
- Overrides
Show child attributes
Show child attributes
Control to have streaming of the endpoint. If the last node before the output is a completion node, you can set this to true to get the output as soon as the completion node has a token
Arbitrary user-defined metadata that can be attached to the process operations and will be registered in the interaction.
Response
Successful Response
⌘I

