Skip to content

CodePipelineStepDefinition

A step of a code pipeline phase: one prompt to one agent.

Kind: an object, used in requests and responses. In a request it is called CodePipelineStepDefinitionInput.

FieldTypeRequiredDescription
namestringThe step’s name, unique within its phase.
agentNamestringThe agent that runs the step. When set, targetRole and targetTags are ignored; when empty, the step runs on an agent matching them.
targetRoleCodePipelineAgentRole| nullInstead of naming an agent, run on any agent with this role. Chosen when the run starts; parallel steps that name the same role are spread across different agents where there are enough.
targetTagsstring[] | nullInstead of naming an agent, run on any agent carrying at least one of these tags (ignoring case). With targetRole as well, the agent must match both.
promptstringThe step’s prompt. It can use the same template syntax as interactions: %%input:name%% for a run input, %%name%% for a variable, {{if}} and {{unless}} blocks, and @prompt(name), replaced with a prompt file when you deploy.
dependsOnstring[] | nullOther steps in the same phase that must finish before this one starts. One agent’s steps always run in their listed order without it.
isCommitablebooleanWhether the agent’s code changes are committed when the step finishes.
commitRepoNamestring | nullFor a run with several repositories, the name of the one this step commits to. Null: the first repository.
isStructuredOutputbooleanWhether to ask the agent, after the step, for a structured summary of how it went (recorded as the step’s outputStructured).
outputJsonSchemastring | nullA JSON schema the step’s final result must match. Output that doesn’t match is repaired where possible.
isOutputSchemaRequiredbooleanWhether the step fails when its result can’t be made to match outputJsonSchema.
outputVariableNamestring | nullA variable to store the step’s final result in, so later step prompts (%%name%%) and hooks can use it.
outputFileNamestring | nullA file name to write the step’s output to, in the run’s output_files/ folder.
preHookstring | nullThe name of a hook (a Cogniscript method in the pipeline’s hooks) to run before the step.
postHookstring | nullThe name of a hook to run after the step finishes.
onFailHookstring | nullThe name of a hook to run when the step fails. It returns JSON with a decision: "continue" marks the step skipped and carries on, "retry" runs the step again, and "fail" fails it as usual.
isNewSessionbooleanWhether the agent starts a fresh session for this step instead of continuing from its previous step. Use it for independent pieces of work, where earlier context would only confuse. Default false.
runChallengeLoopbooleanWhether, after the step succeeds, the same agent is asked whether its work is really built and tested, and is sent its open concerns back until it says it is done or maxCheckLoops rounds have run. Each round is recorded in the step’s challengeLoopTurns.
durationWarningtimespan | nullNot used by code pipeline runs.
durationAutoTerminationtimespan | nullThe longest the step may run before it is stopped. Null: the phase’s value, then the pipeline’s, applies.
durationActivityTimeouttimespan | nullHow long the step may go without activity before it is stopped. Null: the phase’s value, then the pipeline’s, applies.
{
"name": "...",
"agentName": "...",
"targetRole": "Architect",
"targetTags": [
"..."
],
"prompt": "...",
"dependsOn": [
"..."
],
"isCommitable": false,
"commitRepoName": "...",
"isStructuredOutput": false,
"outputJsonSchema": "...",
"isOutputSchemaRequired": false,
"outputVariableName": "...",
"outputFileName": "...",
"preHook": "...",
"postHook": "...",
"onFailHook": "...",
"isNewSession": false,
"runChallengeLoop": false,
"durationWarning": "00:05:00",
"durationAutoTermination": "00:05:00",
"durationActivityTimeout": "00:05:00"
}

Every field is present in a response; empty ones are null.

FieldTypeDescription
namestringThe step’s name, unique within its phase.
agentNamestringThe agent that runs the step. When set, targetRole and targetTags are ignored; when empty, the step runs on an agent matching them.
targetRoleCodePipelineAgentRole| nullInstead of naming an agent, run on any agent with this role. Chosen when the run starts; parallel steps that name the same role are spread across different agents where there are enough.
targetTagsstring[] | nullInstead of naming an agent, run on any agent carrying at least one of these tags (ignoring case). With targetRole as well, the agent must match both.
promptstringThe step’s prompt. It can use the same template syntax as interactions: %%input:name%% for a run input, %%name%% for a variable, {{if}} and {{unless}} blocks, and @prompt(name), replaced with a prompt file when you deploy.
dependsOnstring[] | nullOther steps in the same phase that must finish before this one starts. One agent’s steps always run in their listed order without it.
isCommitablebooleanWhether the agent’s code changes are committed when the step finishes.
commitRepoNamestring | nullFor a run with several repositories, the name of the one this step commits to. Null: the first repository.
isStructuredOutputbooleanWhether to ask the agent, after the step, for a structured summary of how it went (recorded as the step’s outputStructured).
outputJsonSchemastring | nullA JSON schema the step’s final result must match. Output that doesn’t match is repaired where possible.
isOutputSchemaRequiredbooleanWhether the step fails when its result can’t be made to match outputJsonSchema.
outputVariableNamestring | nullA variable to store the step’s final result in, so later step prompts (%%name%%) and hooks can use it.
outputFileNamestring | nullA file name to write the step’s output to, in the run’s output_files/ folder.
preHookstring | nullThe name of a hook (a Cogniscript method in the pipeline’s hooks) to run before the step.
postHookstring | nullThe name of a hook to run after the step finishes.
onFailHookstring | nullThe name of a hook to run when the step fails. It returns JSON with a decision: "continue" marks the step skipped and carries on, "retry" runs the step again, and "fail" fails it as usual.
isNewSessionbooleanWhether the agent starts a fresh session for this step instead of continuing from its previous step. Use it for independent pieces of work, where earlier context would only confuse. Default false.
runChallengeLoopbooleanWhether, after the step succeeds, the same agent is asked whether its work is really built and tested, and is sent its open concerns back until it says it is done or maxCheckLoops rounds have run. Each round is recorded in the step’s challengeLoopTurns.
durationWarningtimespan | nullNot used by code pipeline runs.
durationAutoTerminationtimespan | nullThe longest the step may run before it is stopped. Null: the phase’s value, then the pipeline’s, applies.
durationActivityTimeouttimespan | nullHow long the step may go without activity before it is stopped. Null: the phase’s value, then the pipeline’s, applies.
{
"name": "...",
"agentName": "...",
"targetRole": "Architect",
"targetTags": [
"..."
],
"prompt": "...",
"dependsOn": [
"..."
],
"isCommitable": false,
"commitRepoName": "...",
"isStructuredOutput": false,
"outputJsonSchema": "...",
"isOutputSchemaRequired": false,
"outputVariableName": "...",
"outputFileName": "...",
"preHook": "...",
"postHook": "...",
"onFailHook": "...",
"isNewSession": false,
"runChallengeLoop": false,
"durationWarning": "00:05:00",
"durationAutoTermination": "00:05:00",
"durationActivityTimeout": "00:05:00"
}